Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: nspr/pr/include/obsolete/prsem.h

Issue 2078763002: Delete bundled copy of NSS and replace with README. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/nss@master
Patch Set: Delete bundled copy of NSS and replace with README. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « nspr/pr/include/obsolete/protypes.h ('k') | nspr/pr/include/pratom.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 #ifndef prsem_h___
7 #define prsem_h___
8
9 /*
10 ** API for counting semaphores. Semaphores are counting synchronizing
11 ** variables based on a lock and a condition variable. They are lightweight
12 ** contention control for a given count of resources.
13 */
14 #include "prtypes.h"
15
16 PR_BEGIN_EXTERN_C
17
18 typedef struct PRSemaphore PRSemaphore;
19
20 /*
21 ** Create a new semaphore object.
22 */
23 NSPR_API(PRSemaphore*) PR_NewSem(PRUintn value);
24
25 /*
26 ** Destroy the given semaphore object.
27 **
28 */
29 NSPR_API(void) PR_DestroySem(PRSemaphore *sem);
30
31 /*
32 ** Wait on a Semaphore.
33 **
34 ** This routine allows a calling thread to wait or proceed depending upon the
35 ** state of the semahore sem. The thread can proceed only if the counter value
36 ** of the semaphore sem is currently greater than 0. If the value of semaphore
37 ** sem is positive, it is decremented by one and the routine returns immediately
38 ** allowing the calling thread to continue. If the value of semaphore sem is 0,
39 ** the calling thread blocks awaiting the semaphore to be released by another
40 ** thread.
41 **
42 ** This routine can return PR_PENDING_INTERRUPT if the waiting thread
43 ** has been interrupted.
44 */
45 NSPR_API(PRStatus) PR_WaitSem(PRSemaphore *sem);
46
47 /*
48 ** This routine increments the counter value of the semaphore. If other threads
49 ** are blocked for the semaphore, then the scheduler will determine which ONE
50 ** thread will be unblocked.
51 */
52 NSPR_API(void) PR_PostSem(PRSemaphore *sem);
53
54 /*
55 ** Returns the value of the semaphore referenced by sem without affecting
56 ** the state of the semaphore. The value represents the semaphore vaule
57 F** at the time of the call, but may not be the actual value when the
58 ** caller inspects it.
59 */
60 NSPR_API(PRUintn) PR_GetValueSem(PRSemaphore *sem);
61
62 PR_END_EXTERN_C
63
64 #endif /* prsem_h___ */
OLDNEW
« no previous file with comments | « nspr/pr/include/obsolete/protypes.h ('k') | nspr/pr/include/pratom.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698