summaryrefslogtreecommitdiff
path: root/src/server/httpd.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-12-23 08:52:02 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-12-23 08:52:02 +0000
commitfb86d0e76d280c544f28ff1396c706f4e19d77ca (patch)
tree2a5df28281e6f46e542a2f624d287a27734da3ef /src/server/httpd.c
parent6e1184dcffaf807476ab312404c1bc0a32c38c36 (diff)
downloadopenocd+libswd-fb86d0e76d280c544f28ff1396c706f4e19d77ca.tar.gz
openocd+libswd-fb86d0e76d280c544f28ff1396c706f4e19d77ca.tar.bz2
openocd+libswd-fb86d0e76d280c544f28ff1396c706f4e19d77ca.tar.xz
openocd+libswd-fb86d0e76d280c544f28ff1396c706f4e19d77ca.zip
httpd wip
git-svn-id: svn://svn.berlios.de/openocd/trunk@1272 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/server/httpd.c')
-rw-r--r--src/server/httpd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server/httpd.c b/src/server/httpd.c
index 103c92f0..4b876d30 100644
--- a/src/server/httpd.c
+++ b/src/server/httpd.c
@@ -429,9 +429,14 @@ static int ahc_echo(void * cls, struct MHD_Connection * connection,
}
static struct MHD_Daemon * d;
+static pthread_mutex_t mutex;
+
int httpd_start(void)
{
+ pthread_mutexattr_t attr;
+ pthread_mutexattr_init( &attr );
+ pthread_mutex_init( &mutex, &attr );
int port = 8888;
LOG_USER("Launching httpd server on port %d", port);
@@ -461,15 +466,16 @@ int httpd_start(void)
void httpd_stop(void)
{
MHD_stop_daemon(d);
+ pthread_mutex_destroy( &mutex );
}
void openocd_sleep_prelude(void)
{
- /* FIX!!!! add locking here!!!! */
+ pthread_mutex_unlock( &mutex );
}
void openocd_sleep_postlude(void)
{
- /* FIX!!!! add locking here!!!! */
+ pthread_mutex_lock( &mutex );
}