home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / nspr30-v.zip / nspr30-v / include / prcmon.h < prev    next >
C/C++ Source or Header  |  1998-07-21  |  2KB  |  74 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. #ifndef prcmon_h___
  20. #define prcmon_h___
  21.  
  22. /*
  23. ** Interface to cached monitors. Cached monitors use an address to find a
  24. ** given PR monitor. In this way a monitor can be associated with another
  25. ** object without preallocating a monitor for all objects.
  26. **
  27. ** A hash table is used to quickly map addresses to individual monitors
  28. ** and the system automatically grows the hash table as needed.
  29. **
  30. ** Cache monitors are about 5 times slower to use than uncached monitors.
  31. */
  32. #include "prmon.h"
  33. #include "prinrval.h"
  34.  
  35. PR_BEGIN_EXTERN_C
  36.  
  37. /**
  38. ** Like PR_EnterMonitor except use the "address" to find a monitor in the
  39. ** monitor cache. If successful, returns the PRMonitor now associated
  40. ** with "address". Note that you must PR_CExitMonitor the address to
  41. ** release the monitor cache entry (otherwise the monitor cache will fill
  42. ** up). This call will return NULL if the monitor cache needs to be
  43. ** expanded and the system is out of memory.
  44. */
  45. PR_EXTERN(PRMonitor*) PR_CEnterMonitor(void *address);
  46.  
  47. /*
  48. ** Like PR_ExitMonitor except use the "address" to find a monitor in the
  49. ** monitor cache.
  50. */
  51. PR_EXTERN(PRStatus) PR_CExitMonitor(void *address);
  52.  
  53. /*
  54. ** Like PR_Wait except use the "address" to find a monitor in the
  55. ** monitor cache.
  56. */
  57. PR_EXTERN(PRStatus) PR_CWait(void *address, PRIntervalTime timeout);
  58.  
  59. /*
  60. ** Like PR_Notify except use the "address" to find a monitor in the
  61. ** monitor cache.
  62. */
  63. PR_EXTERN(PRStatus) PR_CNotify(void *address);
  64.  
  65. /*
  66. ** Like PR_NotifyAll except use the "address" to find a monitor in the
  67. ** monitor cache.
  68. */
  69. PR_EXTERN(PRStatus) PR_CNotifyAll(void *address);
  70.  
  71. PR_END_EXTERN_C
  72.  
  73. #endif /* prcmon_h___ */
  74.