2023-02-08 11:04:11 +00:00
|
|
|
//
|
|
|
|
// NamedEvent_UNIX.h
|
|
|
|
//
|
|
|
|
// Library: Foundation
|
|
|
|
// Package: Processes
|
|
|
|
// Module: NamedEvent
|
|
|
|
//
|
|
|
|
// Definition of the NamedEventImpl class for Unix.
|
|
|
|
//
|
|
|
|
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
|
|
|
// and Contributors.
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef Foundation_NamedEvent_UNIX_INCLUDED
|
|
|
|
#define Foundation_NamedEvent_UNIX_INCLUDED
|
|
|
|
|
|
|
|
|
|
|
|
#include "Poco/Foundation.h"
|
|
|
|
#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
|
2023-02-13 09:22:33 +00:00
|
|
|
# include <semaphore.h>
|
2023-02-08 11:04:11 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2023-02-13 09:22:33 +00:00
|
|
|
namespace Poco
|
|
|
|
{
|
2023-02-08 11:04:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Foundation_API NamedEventImpl
|
|
|
|
{
|
|
|
|
protected:
|
2023-02-13 09:22:33 +00:00
|
|
|
NamedEventImpl(const std::string & name);
|
|
|
|
~NamedEventImpl();
|
|
|
|
void setImpl();
|
|
|
|
void waitImpl();
|
|
|
|
|
2023-02-08 11:04:11 +00:00
|
|
|
private:
|
2023-02-13 09:22:33 +00:00
|
|
|
std::string getFileName();
|
2023-02-08 11:04:11 +00:00
|
|
|
|
2023-02-13 09:22:33 +00:00
|
|
|
std::string _name;
|
2023-02-08 11:04:11 +00:00
|
|
|
#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
|
2023-02-13 09:22:33 +00:00
|
|
|
sem_t * _sem;
|
2023-02-08 11:04:11 +00:00
|
|
|
#else
|
2023-02-13 09:22:33 +00:00
|
|
|
int _semid; // semaphore id
|
2023-02-08 11:04:11 +00:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace Poco
|
|
|
|
|
|
|
|
|
|
|
|
#endif // Foundation_NamedEvent_UNIX_INCLUDED
|