|
|
@@ -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 ); |
|
|
|
} |
|
|
|
|