#ifndef EVENT_HPP_INCLUDED
#define EVENT_HPP_INCLUDED

// Copyright (c) 2007 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt

struct timespec;

class event
{
private:

    bool is_set_;

public:

    event();

    void set();
    void reset();

    int wait();
    int try_wait();
    int timed_wait( timespec const & abstime );

    int lock();
    int try_lock();
    int timed_lock( timespec const & abstime );
    int unlock();

    bool unlocked_is_set() const;
    void unlocked_set();
    void unlocked_reset();
};

#endif // #ifndef EVENT_HPP_INCLUDED

