/*
This file is part of drd, a data race detector.
- Copyright (C) 2006-2008 Bart Van Assche
- bart.vanassche@gmail.com
+ Copyright (C) 2006-2009 Bart Van Assche <bart.vanassche@gmail.com>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
*/
+#include "drd_basics.h"
#include "drd_clientobj.h"
#include "drd_error.h"
#include "drd_mutex.h"
}
}
+void DRD_(spinlock_init_or_unlock)(const Addr spinlock)
+{
+ struct mutex_info* mutex_p = mutex_get(spinlock);
+ if (mutex_p)
+ {
+ mutex_unlock(spinlock, mutex_type_spinlock);
+ }
+ else
+ {
+ mutex_init(spinlock, mutex_type_spinlock);
+ }
+}
+
const char* mutex_get_typename(struct mutex_info* const p)
{
tl_assert(p);
void mutex_post_lock(const Addr mutex, const Bool took_lock,
const Bool post_cond_wait);
void mutex_unlock(const Addr mutex, const MutexT mutex_type);
+void DRD_(spinlock_init_or_unlock)(const Addr spinlock);
const char* mutex_get_typename(struct mutex_info* const p);
const char* mutex_type_name(const MutexT mt);
Bool mutex_is_locked_by(const Addr mutex, const DrdThreadId tid);