tor-browser

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

atomic_operations.rst (1165B)


      1 This chapter describes the global functions you use to perform atomic
      2 operations. The functions define a portable API that may be reliably
      3 used in any environment. Since not all operating environments provide
      4 access to such functions, their performance may vary considerably.
      5 
      6 .. _Atomic_Operations_Functions:
      7 
      8 Atomic Operations Functions
      9 ---------------------------
     10 
     11 The API defined for the atomic functions is consistent across all
     12 supported platforms. However, the implementation may vary greatly, and
     13 hence the performance. On systems that do not provide direct access to
     14 atomic operators, NSPR emulates the capabilities by using its own
     15 locking mechanisms. For such systems, NSPR performs atomic operations
     16 just as efficiently as the client could. Therefore, to preserve
     17 portability, it is recommended that clients use the NSPR API for atomic
     18 operations.
     19 
     20 These functions operate on 32-bit integers:
     21 
     22 -  :ref:`PR_AtomicIncrement`
     23 -  :ref:`PR_AtomicDecrement`
     24 -  :ref:`PR_AtomicSet`
     25 -  :ref:`PR_AtomicAdd`
     26 
     27 These functions implement a simple stack data structure:
     28 
     29 -  :ref:`PR_CreateStack`
     30 -  :ref:`PR_StackPush`
     31 -  :ref:`PR_StackPop`
     32 -  :ref:`PR_DestroyStack`