aboutsummaryrefslogtreecommitdiff
path: root/schedule.h
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2010-08-28 20:14:36 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2010-11-14 22:05:45 +0100
commit7aa6c12a4424d00ea0add0a849f8a5b31a2de6a1 (patch)
treea7bd2aef0c2cccaa79ad6a99785fd4f1d606fcd7 /schedule.h
parentAdded check for variable CONFIGURE_DEFINES into options.c (diff)
downloadopenvpn-7aa6c12a4424d00ea0add0a849f8a5b31a2de6a1.tar.xz
Clean-up: Remove pthread and mutex locking code
This code was not activated at all, and hard coded as disabled in syshead.h with this code snippet: /* * Pthread support is currently experimental (and quite unfinished). */ #if 1 /* JYFIXME -- if defined, disable pthread */ #undef USE_PTHREAD #endif So no matter if --enable-pthread when running ./configure or not, this feature was never enabled in reality. Further, by removing the blocker code above made OpenVPN uncompilable in the current state. As the threading part needs to be completely rewritten and pthreading will not be supported in OpenVPN 2.x, removing this code seems most reasonable. In addition, a lot of mutex locking code was also removed, as they were practically NOP functions, due to pthreading being forcefully disabled Signed-off-by: David Sommerseth <dazo@users.sourceforge.net> Acked-by: James Yonan <james@openvpn.net>
Diffstat (limited to '')
-rw-r--r--schedule.h8
1 files changed, 0 insertions, 8 deletions
diff --git a/schedule.h b/schedule.h
index e2a5e0d..d881c38 100644
--- a/schedule.h
+++ b/schedule.h
@@ -42,7 +42,6 @@
/*#define SCHEDULE_TEST*/
#include "otime.h"
-#include "thread.h"
#include "error.h"
struct schedule_entry
@@ -56,7 +55,6 @@ struct schedule_entry
struct schedule
{
- MUTEX_DEFINE (mutex);
struct schedule_entry *earliest_wakeup; /* cached earliest wakeup */
struct schedule_entry *root; /* the root of the treap (btree) */
};
@@ -100,14 +98,12 @@ schedule_add_entry (struct schedule *s,
const struct timeval *tv,
unsigned int sigma)
{
- mutex_lock (&s->mutex);
if (!IN_TREE (e) || !sigma || !tv_within_sigma (tv, &e->tv, sigma))
{
e->tv = *tv;
schedule_add_modify (s, e);
s->earliest_wakeup = NULL; /* invalidate cache */
}
- mutex_unlock (&s->mutex);
}
/*
@@ -122,8 +118,6 @@ schedule_get_earliest_wakeup (struct schedule *s,
{
struct schedule_entry *ret;
- mutex_lock (&s->mutex);
-
/* cache result */
if (!s->earliest_wakeup)
s->earliest_wakeup = schedule_find_least (s->root);
@@ -131,8 +125,6 @@ schedule_get_earliest_wakeup (struct schedule *s,
if (ret)
*wakeup = ret->tv;
- mutex_unlock (&s->mutex);
-
return ret;
}