home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / nsprpub / pr / include / pratom.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  1.8 KB  |  68 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /*
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  * 
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  * 
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. /* GLOBAL FUNCTIONS:
  20. ** DESCRIPTION:
  21. **     PR Atomic operations
  22. */
  23.  
  24. #ifndef pratom_h___
  25. #define pratom_h___
  26.  
  27. #include "prtypes.h"
  28.  
  29. PR_BEGIN_EXTERN_C
  30.  
  31. /*
  32. ** FUNCTION: PR_AtomicIncrement
  33. ** DESCRIPTION:
  34. **    Atomically increment a 32 bit value.
  35. ** INPUTS:
  36. **    val:  a pointer to the value to increment
  37. ** RETURN:
  38. **    the returned value has the same sign as the result
  39. */
  40. PR_EXTERN(PRInt32)    PR_AtomicIncrement(PRInt32 *val);
  41.  
  42. /*
  43. ** FUNCTION: PR_AtomicDecrement
  44. ** DESCRIPTION:
  45. **    Atomically decrement a 32 bit value.
  46. ** INPUTS:
  47. **    val:  a pointer to the value to decrement
  48. ** RETURN:
  49. **    the returned value has the same sign as the result
  50. */
  51. PR_EXTERN(PRInt32)    PR_AtomicDecrement(PRInt32 *val);
  52.  
  53. /*
  54. ** FUNCTION: PR_AtomicSet
  55. ** DESCRIPTION:
  56. **    Atomically set a 32 bit value.
  57. ** INPUTS:
  58. **    val: A pointer to a 32 bit value to bet set
  59. **    newval: The newvalue to assign to val
  60. ** RETURN:
  61. **    Returns the prior value
  62. */
  63. PR_EXTERN(PRInt32) PR_AtomicSet(PRInt32 *val, PRInt32 newval);
  64.  
  65. PR_END_EXTERN_C
  66.  
  67. #endif /* pratom_h___ */
  68.