diff --git a/src/xpdev/msg_queue.c b/src/xpdev/msg_queue.c
index 35b1efb4fde3b35a3b50e6fea6759924135de402..87ce76d2e2702237024196f4d16d64bca22677e5 100644
--- a/src/xpdev/msg_queue.c
+++ b/src/xpdev/msg_queue.c
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2005 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright Rob Swindell - http://www.synchro.net/copyright.html			*
  *																			*
  * This library is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU Lesser General Public License		*
@@ -63,6 +63,14 @@ msg_queue_t* DLLCALL msgQueueInit(msg_queue_t* q, long flags)
 	return(q);
 }
 
+BOOL DLLCALL msgQueueOwner(msg_queue_t* q)
+{
+	if(q==NULL)
+		return(FALSE);
+
+	return q->owner_thread_id == pthread_self();
+}
+
 BOOL DLLCALL msgQueueFree(msg_queue_t* q)
 {
 	if(q==NULL)
@@ -204,7 +212,7 @@ void* DLLCALL msgQueuePeek(msg_queue_t* q, long timeout)
 #endif
 		;
 
-	return listNodeData(listFirstNode(list));
+	return  listNodeData(listFirstNode(list));
 }
 
 void* DLLCALL msgQueueFind(msg_queue_t* q, const void* data, size_t length)
diff --git a/src/xpdev/msg_queue.h b/src/xpdev/msg_queue.h
index aa0fa607610d4b70f909557167a4f47927a4d2d1..f831edc55d7bb3c40fb39fee275a230d0126c938 100644
--- a/src/xpdev/msg_queue.h
+++ b/src/xpdev/msg_queue.h
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright Rob Swindell - http://www.synchro.net/copyright.html			*
  *																			*
  * This library is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU Lesser General Public License		*
@@ -64,6 +64,7 @@ DLLEXPORT BOOL			DLLCALL msgQueueFree(msg_queue_t*);
 
 DLLEXPORT long			DLLCALL msgQueueAttach(msg_queue_t*);
 DLLEXPORT long			DLLCALL msgQueueDetach(msg_queue_t*);
+DLLEXPORT BOOL			DLLCALL msgQueueOwner(msg_queue_t*);
 
 /* Get/Set queue private data */
 DLLEXPORT void*			DLLCALL msgQueueSetPrivateData(msg_queue_t*, void*);