Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / libedataserver / e-flag.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* 
3  * Copyright (C) 2007 Novell, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of version 2 of the GNU Lesser General Public
7  * License as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef E_FLAG_H
21 #define E_FLAG_H
22
23 /* An EFlag is essentially a binary semaphore with a more intuitive interface.
24  * Based on Python's threading.Event class ("EEvent" was already taken). */
25
26 #include <glib.h>
27
28 G_BEGIN_DECLS
29
30 typedef struct _EFlag EFlag;
31
32 EFlag *         e_flag_new                      (void);
33 gboolean        e_flag_is_set                   (EFlag *flag);
34 void            e_flag_set                      (EFlag *flag);
35 void            e_flag_clear                    (EFlag *flag);
36 void            e_flag_wait                     (EFlag *flag);
37 gboolean        e_flag_timed_wait               (EFlag *flag,
38                                                  GTimeVal *abs_time);
39 void            e_flag_free                     (EFlag *flag);
40
41 G_END_DECLS
42
43 #endif /* E_FLAG_H */