bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 1 | |
| 2 | /*--------------------------------------------------------------------*/ |
| 3 | /*--- Private scheduler lock header. priv_sched-lock.h ---*/ |
| 4 | /*--- ---*/ |
| 5 | /*--- Scheduler lock API. ---*/ |
| 6 | /*--------------------------------------------------------------------*/ |
| 7 | |
| 8 | /* |
| 9 | This file is part of Valgrind, a dynamic binary instrumentation |
| 10 | framework. |
| 11 | |
sewardj | 0f157dd | 2013-10-18 14:27:36 +0000 | [diff] [blame] | 12 | Copyright (C) 2011-2013 Bart Van Assche <bvanassche@acm.org>. |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 13 | |
| 14 | This program is free software; you can redistribute it and/or |
| 15 | modify it under the terms of the GNU General Public License as |
| 16 | published by the Free Software Foundation; either version 2 of the |
| 17 | License, or (at your option) any later version. |
| 18 | |
| 19 | This program is distributed in the hope that it will be useful, but |
| 20 | WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 22 | General Public License for more details. |
| 23 | |
| 24 | You should have received a copy of the GNU General Public License |
| 25 | along with this program; if not, write to the Free Software |
| 26 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
| 27 | 02111-1307, USA. |
| 28 | |
| 29 | The GNU General Public License is contained in the file COPYING. |
| 30 | */ |
| 31 | |
| 32 | #ifndef __PRIV_SCHED_LOCK_H |
| 33 | #define __PRIV_SCHED_LOCK_H |
| 34 | |
florian | 535fb1b | 2013-09-15 13:54:34 +0000 | [diff] [blame] | 35 | #include "pub_core_basics.h" // Bool |
| 36 | |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 37 | struct sched_lock; |
| 38 | |
| 39 | enum SchedLockType { sched_lock_generic, sched_lock_ticket }; |
| 40 | |
| 41 | Bool ML_(set_sched_lock_impl)(const enum SchedLockType t); |
florian | cd19e99 | 2012-11-03 19:32:28 +0000 | [diff] [blame] | 42 | const HChar *ML_(get_sched_lock_name)(void); |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 43 | struct sched_lock *ML_(create_sched_lock)(void); |
| 44 | void ML_(destroy_sched_lock)(struct sched_lock *p); |
| 45 | int ML_(get_sched_lock_owner)(struct sched_lock *p); |
| 46 | void ML_(acquire_sched_lock)(struct sched_lock *p); |
| 47 | void ML_(release_sched_lock)(struct sched_lock *p); |
| 48 | |
| 49 | #endif // __PRIV_SCHED_LOCK_H |
| 50 | |
| 51 | /*--------------------------------------------------------------------*/ |
| 52 | /*--- end ---*/ |
| 53 | /*--------------------------------------------------------------------*/ |