Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
735 B

  1. // xmutex.cpp -- implement mutex lock for iostreams
  2. #include <yvals.h>
  3. #include <xdebug>
  4. #if _MULTI_THREAD
  5. #include "xmtx.h"
  6. _STD_BEGIN
  7. _Mutex::_Mutex()
  8. : _Mtx(_NEW_CRT _Rmtx)
  9. { // initialize recursive mutex object
  10. _Mtxinit((_Rmtx*)_Mtx);
  11. }
  12. _Mutex::~_Mutex()
  13. { // release resources allocated to mutex object
  14. _Mtxdst((_Rmtx*)_Mtx);
  15. _DELETE_CRT((_Rmtx*)_Mtx);
  16. }
  17. void _Mutex::_Lock()
  18. { // lock mutex
  19. _Mtxlock((_Rmtx*)_Mtx);
  20. }
  21. void _Mutex::_Unlock()
  22. { // unlock mutex
  23. _Mtxunlock((_Rmtx*)_Mtx);
  24. }
  25. _STD_END
  26. #endif /* _MULTI_THREAD */
  27. /*
  28. * Copyright (c) 1992-2001 by P.J. Plauger. ALL RIGHTS RESERVED.
  29. * Consult your license regarding permissions and restrictions.
  30. V3.10:0009 */