MPSolve  3.2.1
mt-types.h
Go to the documentation of this file.
1 /*
2  * This file is part of MPSolve 3.2.1
3  *
4  * Copyright (C) 2001-2020, Dipartimento di Matematica "L. Tonelli", Pisa.
5  * License: http://www.gnu.org/licenses/gpl.html GPL version 3 or higher
6  *
7  * Authors:
8  * Leonardo Robol <leonardo.robol@unipi.it>
9  */
10 
11 #include <pthread.h>
12 #include <mps/mps.h>
13 
20 #ifndef MPS_MT_TYPES_
21 #define MPS_MT_TYPES_
22 
23 #define MPS_LOCK(x) (pthread_mutex_lock (&(x).mutex))
24 
25 #define MPS_UNLOCK(x) (pthread_mutex_unlock (&(x).mutex))
26 
27 #define MPS_INIT_LOCK(x) (pthread_mutex_init (&(x).mutex, NULL))
28 
36  mps_boolean value;
37  pthread_mutex_t mutex;
38 };
39 
47  long int value;
48  pthread_mutex_t mutex;
49 };
50 
51 #ifndef __cplusplus
52 typedef struct mps_boolean_mt mps_boolean_mt;
53 typedef struct mps_long_int_mt mps_long_int_mt;
54 
55 #endif
56 #endif
Header file for libmps.
A thread safe version of mps_boolean.
Definition: mt-types.h:35
A thread safe version of mps_boolean.
Definition: mt-types.h:46