tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

process_initialization.rst (1768B)


      1 Process Initialization
      2 ======================
      3 
      4 This chapter describes the NSPR API for versioning, process
      5 initialization, and shutdown of NSPR.
      6 
      7 -  `Identity and Versioning <#Identity_and_Versioning>`__
      8 -  `Initialization and Cleanup <#Initialization_and_Cleanup>`__
      9 -  `Module Initialization <#Module_Initialization>`__
     10 
     11 .. _Identity_and_Versioning:
     12 
     13 Identity and Versioning
     14 -----------------------
     15 
     16 .. _Name_and_Version_Constants:
     17 
     18 Name and Version Constants
     19 ~~~~~~~~~~~~~~~~~~~~~~~~~~
     20 
     21 - :ref:`PR_NAME`
     22 - :ref:`PR_VERSION`
     23 - :ref:`PR_VersionCheck`
     24 
     25 .. _Initialization_and_Cleanup:
     26 
     27 Initialization and Cleanup
     28 --------------------------
     29 
     30 NSPR detects whether the library has been initialized and performs
     31 implicit initialization if it hasn't. Implicit initialization should
     32 suffice unless a program has specific sequencing requirements or needs
     33 to characterize the primordial thread. Explicit initialization is rarely
     34 necessary.
     35 
     36 Implicit initialization assumes that the initiator is the primordial
     37 thread and that the thread is a user thread of normal priority.
     38 
     39 - :ref:`PR_Init`
     40 - :ref:`PR_Initialize`
     41 - :ref:`PR_Initialized`
     42 - :ref:`PR_Cleanup`
     43 - :ref:`PR_DisableClockInterrupts`
     44 - :ref:`PR_BlockClockInterrupts`
     45 - :ref:`PR_UnblockClockInterrupts`
     46 - :ref:`PR_SetConcurrency`
     47 - :ref:`PR_ProcessExit`
     48 - :ref:`PR_Abort`
     49 
     50 .. _Module_Initialization:
     51 
     52 Module Initialization
     53 ~~~~~~~~~~~~~~~~~~~~~
     54 
     55 Initialization can be tricky in a threaded environment, especially
     56 initialization that must happen exactly once. :ref:`PR_CallOnce` ensures
     57 that such initialization code is called only once. This facility is
     58 recommended in situations where complicated global initialization is
     59 required.
     60 
     61 - :ref:`PRCallOnceType`
     62 - :ref:`PRCallOnceFN`
     63 - :ref:`PR_CallOnce`