File:  [parser3project] / parser3 / src / targets / isapi / Attic / pa_threads.C
Revision 1.17.12.1: download - view: text, annotated - select for diffs - revision graph
Sun Apr 9 12:25:04 2006 UTC (20 years, 3 months ago) by paf
Diff to: branchpoint 1.17: preferred, unified
! switched to VS2005 (projects and object<info explicitly typed>.for_each(, info))
+ $response:field[] setting void means removing
+ grammar $name` name stops now, for mysql `$field`
+ started ^break[] ^continue[], in ^for. TODO: to other iterators (while, menu, foreach)
+ all log messages += [uri=, method=, cl=]

/** @file
	Parser: zero Mutex realization class.

	Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com)
	Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
*/

static const char * const IDENT_THREADS_C="$Date: 2006/04/09 12:25:04 $";

#include "pa_threads.h"

#define  WINVER  0x0400
#include <windows.h>

const bool parser_multithreaded=true;

pa_thread_t pa_get_thread_id() {
	return GetCurrentThreadId();
}

Mutex global_mutex;

Mutex::Mutex() :
	handle(reinterpret_cast<uint>(CreateMutex(NULL, FALSE, 0))) {
}

Mutex::~Mutex() {
	CloseHandle(reinterpret_cast<HANDLE>(handle));
}

void Mutex::acquire() {
    WaitForSingleObject(reinterpret_cast<HANDLE>(handle), INFINITE);
}

void Mutex::release() {
    ReleaseMutex(reinterpret_cast<HANDLE>(handle));
}

E-mail: