Annotation of parser3/src/targets/apache13/pa_threads.C, revision 1.1
1.1 ! parser 1: /** @file
! 2: Parser: Mutex realization class.
! 3:
! 4: Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
! 5: Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
! 6:
! 7: $Id: pa_threads.C,v 1.5 2001/09/26 10:32:26 parser Exp $
! 8: */
! 9:
! 10: #include "pa_threads.h"
! 11:
! 12: Mutex global_mutex;
! 13:
! 14: #include "ap_config.h"
! 15: // defined in ap_config
! 16: #ifdef MULTITHREAD
! 17: #include "multithread.h"
! 18:
! 19: Mutex::Mutex() :
! 20: handle(reinterpret_cast<uint>(ap_create_mutex(0))) {
! 21: }
! 22:
! 23: Mutex::~Mutex() {
! 24: ap_destroy_mutex(reinterpret_cast<mutex *>(handle));
! 25: }
! 26:
! 27: void Mutex::acquire() {
! 28: ap_acquire_mutex(reinterpret_cast<mutex *>(handle));
! 29: }
! 30:
! 31: void Mutex::release() {
! 32: ap_release_mutex(reinterpret_cast<mutex *>(handle));
! 33: }
! 34:
! 35: #else
! 36:
! 37: Mutex::Mutex() {}
! 38: Mutex::~Mutex() {}
! 39: void Mutex::acquire() {}
! 40: void Mutex::release() {}
! 41:
! 42: #endif
E-mail: