pr_queuejob.rst (752B)
1 PR_QueueJob 2 =========== 3 4 Queues a job to a thread pool for execution. 5 6 7 Syntax 8 ------ 9 10 .. code:: 11 12 #include <prtpool.h> 13 14 NSPR_API(PRJob *) 15 PR_QueueJob( 16 PRThreadPool *tpool, 17 PRJobFn fn, 18 void *arg, 19 PRBool joinable 20 ); 21 22 23 Parameters 24 ~~~~~~~~~~ 25 26 The function has the following parameters: 27 28 ``tpool`` 29 A pointer to a :ref:`PRThreadPool` structure previously created by a 30 call to :ref:`PR_CreateThreadPool`. 31 ``fn`` 32 The function to be executed when the job is executed. 33 ``arg`` 34 A pointer to an argument passed to ``fn``. 35 ``joinable`` 36 If ``PR_TRUE``, the job is joinable. If ``PR_FALSE``, the job is not 37 joinable. See :ref:`PR_JoinJob`. 38 39 40 Returns 41 ~~~~~~~ 42 43 Pointer to a :ref:`PRJob` structure or ``NULL`` on error.