00001 // Filename: conditionVarNsprImpl.I 00002 // Created by: drose (09Aug02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: ConditionVarNsprImpl::Constructor 00022 // Access: Public 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 INLINE ConditionVarNsprImpl:: 00026 ConditionVarNsprImpl(MutexNsprImpl &mutex) { 00027 _cvar = PR_NewCondVar(mutex._lock); 00028 nassertv(_cvar != (PRCondVar *)NULL); 00029 } 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Function: ConditionVarNsprImpl::Destructor 00033 // Access: Public 00034 // Description: 00035 //////////////////////////////////////////////////////////////////// 00036 INLINE ConditionVarNsprImpl:: 00037 ~ConditionVarNsprImpl() { 00038 PR_DestroyCondVar(_cvar); 00039 } 00040 00041 //////////////////////////////////////////////////////////////////// 00042 // Function: ConditionVarNsprImpl::wait 00043 // Access: Public 00044 // Description: 00045 //////////////////////////////////////////////////////////////////// 00046 INLINE void ConditionVarNsprImpl:: 00047 wait() { 00048 int status = PR_WaitCondVar(_cvar, PR_INTERVAL_NO_TIMEOUT); 00049 nassertv(status == PR_SUCCESS); 00050 } 00051 00052 //////////////////////////////////////////////////////////////////// 00053 // Function: ConditionVarNsprImpl::signal 00054 // Access: Public 00055 // Description: 00056 //////////////////////////////////////////////////////////////////// 00057 INLINE void ConditionVarNsprImpl:: 00058 signal() { 00059 int status = PR_NotifyCondVar(_cvar); 00060 nassertv(status == PR_SUCCESS); 00061 } 00062 00063 //////////////////////////////////////////////////////////////////// 00064 // Function: ConditionVarNsprImpl::signal_all 00065 // Access: Public 00066 // Description: 00067 //////////////////////////////////////////////////////////////////// 00068 INLINE void ConditionVarNsprImpl:: 00069 signal_all() { 00070 int status = PR_NotifyAllCondVar(_cvar); 00071 nassertv(status == PR_SUCCESS); 00072 }