4 //----------------------------------------------------------------------
5 // Copyright (C) 2006 - 2007 by the FRESCOR consortium:
7 // Universidad de Cantabria, SPAIN
8 // University of York, UK
9 // Scuola Superiore Sant'Anna, ITALY
10 // Kaiserslautern University, GERMANY
11 // Univ. Politecnica Valencia, SPAIN
12 // Czech Technical University in Prague, CZECH REPUBLIC
14 // Thales Communication S.A. FRANCE
15 // Visual Tools S.A. SPAIN
16 // Rapita Systems Ltd UK
19 // See http://www.frescor.org
21 // The FRESCOR project (FP6/2005/IST/5-034026) is funded
22 // in part by the European Union Sixth Framework Programme
23 // The European Union is not liable of any use that may be
27 // based on previous work (FSF) done in the FIRST project
29 // Copyright (C) 2005 Mälardalen University, SWEDEN
30 // Scuola Superiore S.Anna, ITALY
31 // Universidad de Cantabria, SPAIN
32 // University of York, UK
34 // This file is part of DTM (Distributed Transaction Manager)
36 // DTM is free software; you can redistribute it and/or modify it
37 // under terms of the GNU General Public License as published by the
38 // Free Software Foundation; either version 2, or (at your option) any
39 // later version. DTM is distributed in the hope that it will be
40 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
41 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
42 // General Public License for more details. You should have received a
43 // copy of the GNU General Public License along with DTM; see file
44 // COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,
45 // Cambridge, MA 02139, USA.
47 // As a special exception, including DTM header files in a file,
48 // instantiating DTM generics or templates, or linking other files
49 // with DTM objects to produce an executable application, does not
50 // by itself cause the resulting executable application to be covered
51 // by the GNU General Public License. This exception does not
52 // however invalidate any other reasons why the executable file might be
53 // covered by the GNU Public License.
54 // -----------------------------------------------------------------------
59 * @brief Synchronization objects
61 * This module contains the definition of simple synchronization
62 * objects built on top FOSA condition variables.
64 * @author Michael Gonzalez Harbour <mgh@unican.es>
65 * @author Michal Sojka <sojkam1@fel.cvut.cz>
66 * @author Daniel Sangorrin <daniel.sangorrin@unican.es>
73 #include <fosa_mutexes_and_condvars.h>
74 #include <time.h> /* for timespec */
75 #include <fosa_opaque_types.h> /* for FOSA_ETIMEDOUT */
78 * Semaphore-like synchronization object build on top of FOSA's
79 * condition variables.
81 typedef struct forb_syncobj {
88 extern int forb_syncobj_init(forb_syncobj_t *syncobj, int ceiling);
89 extern int forb_syncobj_destroy(forb_syncobj_t *syncobj);
90 extern int forb_syncobj_signal(forb_syncobj_t *syncobj);
91 extern int forb_syncobj_wait(forb_syncobj_t *syncobj);
92 extern int forb_syncobj_timedwait(forb_syncobj_t *syncobj,
93 const struct timespec *abstime);
94 #define FORB_ETIMEDOUT FOSA_ETIMEDOUT
96 #endif // _SYNC_OBJ_H_