--- parser3/src/targets/isapi/Attic/pa_threads.C 2001/09/26 10:32:26 1.3 +++ parser3/src/targets/isapi/Attic/pa_threads.C 2002/01/21 12:10:09 1.6 @@ -2,23 +2,34 @@ Parser: zero Mutex realization class. Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://design.ru/paf) + Author: Alexander Petrosyan (http://paf.design.ru) - $Id: pa_threads.C,v 1.3 2001/09/26 10:32:26 parser Exp $ + $Id: pa_threads.C,v 1.6 2002/01/21 12:10:09 paf Exp $ */ #include "pa_threads.h" +/// @test really? +const bool parser_multithreaded=true; + +pa_thread_t pa_get_thread_id() { + return GetThreadID(); +} + Mutex global_mutex; -Mutex::Mutex() { +Mutex::Mutex() : + handle(static_cast(CreateMutex(NULL, FALSE, 0))) { } Mutex::~Mutex() { + CloseHandle(static_cast(handle)); } void Mutex::acquire() { + WaitForSingleObject(static_cast(handle), INFINITE); } void Mutex::release() { + ReleaseMutex(static_cast(handle)); }