mirror of https://github.com/FreeRDP/FreeRDP
libfreerdp-utils/thread: separate freerdp_thread_free() call.
This commit is contained in:
parent
6757c6ea59
commit
8682228ec4
|
@ -555,6 +555,7 @@ static void disk_free(DEVICE* device)
|
|||
DISK_FILE* file;
|
||||
|
||||
freerdp_thread_stop(disk->thread);
|
||||
freerdp_thread_free(disk->thread);
|
||||
|
||||
while ((irp = (IRP*)list_dequeue(disk->irp_list)) != NULL)
|
||||
irp->Discard(irp);
|
||||
|
|
|
@ -210,6 +210,7 @@ static void printer_free(DEVICE* device)
|
|||
IRP* irp;
|
||||
|
||||
freerdp_thread_stop(printer_dev->thread);
|
||||
freerdp_thread_free(printer_dev->thread);
|
||||
|
||||
while ((irp = (IRP*)list_dequeue(printer_dev->irp_list)) != NULL)
|
||||
irp->Discard(irp);
|
||||
|
|
|
@ -43,11 +43,15 @@ struct _freerdp_thread
|
|||
FREERDP_API freerdp_thread* freerdp_thread_new(void);
|
||||
FREERDP_API void freerdp_thread_start(freerdp_thread* thread, void* func, void* arg);
|
||||
FREERDP_API void freerdp_thread_stop(freerdp_thread* thread);
|
||||
FREERDP_API void freerdp_thread_free(freerdp_thread* thread);
|
||||
|
||||
#define freerdp_thread_wait(_t) wait_obj_select(_t->signals, _t->num_signals, -1)
|
||||
#define freerdp_thread_wait_timeout(_t, _timeout) wait_obj_select(_t->signals, _t->num_signals, _timeout)
|
||||
#define freerdp_thread_is_stopped(_t) wait_obj_is_set(_t->signals[0])
|
||||
#define freerdp_thread_quit(_t) _t->status = -1
|
||||
#define freerdp_thread_is_running(_t) (_t->status == 1)
|
||||
#define freerdp_thread_quit(_t) do { \
|
||||
_t->status = -1; \
|
||||
wait_obj_clear(_t->signals[0]); } while (0)
|
||||
#define freerdp_thread_signal(_t) wait_obj_set(_t->signals[1])
|
||||
#define freerdp_thread_reset(_t) wait_obj_clear(_t->signals[1])
|
||||
#define freerdp_thread_lock(_t) freerdp_mutex_lock(_t->mutex)
|
||||
|
|
|
@ -303,6 +303,7 @@ static void svc_plugin_process_terminated(rdpSvcPlugin* plugin)
|
|||
svc_data_in_item* item;
|
||||
|
||||
freerdp_thread_stop(plugin->priv->thread);
|
||||
freerdp_thread_free(plugin->priv->thread);
|
||||
|
||||
plugin->channel_entry_points.pVirtualChannelClose(plugin->priv->open_handle);
|
||||
xfree(plugin->channel_entry_points.pExtendedData);
|
||||
|
|
|
@ -72,6 +72,11 @@ void freerdp_thread_stop(freerdp_thread* thread)
|
|||
i++;
|
||||
freerdp_usleep(100);
|
||||
}
|
||||
}
|
||||
|
||||
void freerdp_thread_free(freerdp_thread* thread)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < thread->num_signals; i++)
|
||||
wait_obj_free(thread->signals[i]);
|
||||
|
|
Loading…
Reference in New Issue