pr_callonce.rst (1009B)
1 PR_CallOnce 2 =========== 3 4 Ensures that subsystem initialization occurs only once. 5 6 7 Syntax 8 ------ 9 10 .. code:: 11 12 PRStatus PR_CallOnce( 13 PRCallOnceType *once, 14 PRCallOnceFN func); 15 16 17 Parameters 18 ~~~~~~~~~~ 19 20 :ref:`PR_CallOnce` has these parameters: 21 22 ``once`` 23 A pointer to an object of type :ref:`PRCallOnceType`. Initially (before 24 any threading issues exist), the object must be initialized to all 25 zeros. From that time on, the client should consider the object 26 read-only (or even opaque) and allow the runtime to manipulate its 27 content appropriately. 28 ``func`` 29 A pointer to the function the calling client has designed to perform 30 the subsystem initialization. The function will be called once, at 31 most, for each subsystem to be initialized. It should return a 32 :ref:`PRStatus` indicating the result of the initialization process. 33 While the first thread executes this function, other threads 34 attempting the same initialization will be blocked until it has been 35 completed.