1//
2// NamedEvent_UNIX.h
3//
4// Library: Foundation
5// Package: Processes
6// Module: NamedEvent
7//
8// Definition of the NamedEventImpl class for Unix.
9//
10// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
11// and Contributors.
12//
13// SPDX-License-Identifier: BSL-1.0
14//
15
16
17#ifndef Foundation_NamedEvent_UNIX_INCLUDED
18#define Foundation_NamedEvent_UNIX_INCLUDED
19
20
21#include "Poco/Foundation.h"
22#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) || defined(__EMSCRIPTEN__)
23#include <semaphore.h>
24#endif
25
26
27namespace Poco {
28
29
30class Foundation_API NamedEventImpl
31{
32protected:
33 NamedEventImpl(const std::string& name);
34 ~NamedEventImpl();
35 void setImpl();
36 void waitImpl();
37
38private:
39 std::string getFileName();
40
41 std::string _name;
42#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) || defined(__EMSCRIPTEN__)
43 sem_t* _sem;
44#else
45 int _semid; // semaphore id
46#endif
47};
48
49
50} // namespace Poco
51
52
53#endif // Foundation_NamedEvent_UNIX_INCLUDED
54