Annotation of parser3/src/targets/apache13/pa_threads.C, revision 1.3

1.1       parser      1: /** @file
                      2:        Parser: Mutex realization class.
                      3: 
                      4:        Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
1.3     ! paf         5:        Author: Alexander Petrosyan <paf@design.ru> (http://paf.design.ru)
1.1       parser      6: 
1.3     ! paf         7:        $Id: pa_threads.C,v 1.2 2001/10/31 11:23:39 paf Exp $
1.1       parser      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: 
1.2       paf        19: const bool parser_multithreaded=true;
                     20: 
1.1       parser     21: Mutex::Mutex() : 
                     22:        handle(reinterpret_cast<uint>(ap_create_mutex(0))) {
                     23: }
                     24: 
                     25: Mutex::~Mutex() {
                     26:        ap_destroy_mutex(reinterpret_cast<mutex *>(handle));
                     27: }
                     28: 
                     29: void Mutex::acquire() {
                     30:        ap_acquire_mutex(reinterpret_cast<mutex *>(handle));
                     31: }
                     32: 
                     33: void Mutex::release() {
                     34:        ap_release_mutex(reinterpret_cast<mutex *>(handle));
                     35: }
                     36: 
                     37: #else
1.2       paf        38: 
                     39: const bool parser_multithreaded=false;
1.1       parser     40: 
                     41: Mutex::Mutex() {}
                     42: Mutex::~Mutex() {}
                     43: void Mutex::acquire() {}
                     44: void Mutex::release() {}
                     45: 
                     46: #endif

E-mail: