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

Side by Side Diff: nspr/pr/include/prtpool.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/prtime.h ('k') | nspr/pr/include/prtrace.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 prtpool_h___
7 #define prtpool_h___
8
9 #include "prtypes.h"
10 #include "prthread.h"
11 #include "prio.h"
12 #include "prerror.h"
13
14 /*
15 * NOTE:
16 * THIS API IS A PRELIMINARY VERSION IN NSPR 4.0 AND IS SUBJECT TO
17 * CHANGE
18 */
19
20 PR_BEGIN_EXTERN_C
21
22 typedef struct PRJobIoDesc {
23 PRFileDesc *socket;
24 PRErrorCode error;
25 PRIntervalTime timeout;
26 } PRJobIoDesc;
27
28 typedef struct PRThreadPool PRThreadPool;
29 typedef struct PRJob PRJob;
30 typedef void (PR_CALLBACK *PRJobFn) (void *arg);
31
32 /* Create thread pool */
33 NSPR_API(PRThreadPool *)
34 PR_CreateThreadPool(PRInt32 initial_threads, PRInt32 max_threads,
35 PRUint32 stacksize);
36
37 /* queue a job */
38 NSPR_API(PRJob *)
39 PR_QueueJob(PRThreadPool *tpool, PRJobFn fn, void *arg, PRBool joinable);
40
41 /* queue a job, when a socket is readable */
42 NSPR_API(PRJob *)
43 PR_QueueJob_Read(PRThreadPool *tpool, PRJobIoDesc *iod,
44 PRJobFn fn, void * arg, PRBool joinable);
45
46 /* queue a job, when a socket is writeable */
47 NSPR_API(PRJob *)
48 PR_QueueJob_Write(PRThreadPool *tpool, PRJobIoDesc *iod,
49 PRJobFn fn, void * arg, PRBool joinable);
50
51 /* queue a job, when a socket has a pending connection */
52 NSPR_API(PRJob *)
53 PR_QueueJob_Accept(PRThreadPool *tpool, PRJobIoDesc *iod,
54 PRJobFn fn, void * arg, PRBool joinable);
55
56 /* queue a job, when the socket connection to addr succeeds or fails */
57 NSPR_API(PRJob *)
58 PR_QueueJob_Connect(PRThreadPool *tpool, PRJobIoDesc *iod,
59 const PRNetAddr *addr, PRJobFn fn, void * arg, PRBool jo inable);
60
61 /* queue a job, when a timer exipres */
62 NSPR_API(PRJob *)
63 PR_QueueJob_Timer(PRThreadPool *tpool, PRIntervalTime timeout,
64 PRJobFn fn, void * arg, PRBool joinable);
65 /* cancel a job */
66 NSPR_API(PRStatus)
67 PR_CancelJob(PRJob *job);
68
69 /* join a job */
70 NSPR_API(PRStatus)
71 PR_JoinJob(PRJob *job);
72
73 /* shutdown pool */
74 NSPR_API(PRStatus)
75 PR_ShutdownThreadPool(PRThreadPool *tpool);
76
77 /* join pool, wait for exit of all threads */
78 NSPR_API(PRStatus)
79 PR_JoinThreadPool(PRThreadPool *tpool);
80
81 PR_END_EXTERN_C
82
83 #endif /* prtpool_h___ */
OLDNEW
« no previous file with comments | « nspr/pr/include/prtime.h ('k') | nspr/pr/include/prtrace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698