- In the case the port is created in Kernel context force it to stay in kernel team,
as the creation can be initated by a UL thread git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36025 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2,12 +2,11 @@
|
|||||||
* Copyright 2009 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
* Copyright 2009 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||||
* All rights reserved. Distributed under the terms of the MIT License.
|
* All rights reserved. Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef PORTLISTENER_H_
|
#ifndef PORTLISTENER_H_
|
||||||
#define PORTLISTENER_H_
|
#define PORTLISTENER_H_
|
||||||
|
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
|
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename TYPE,
|
typename TYPE,
|
||||||
ssize_t MAX_MESSAGE_SIZE = 256,
|
ssize_t MAX_MESSAGE_SIZE = 256,
|
||||||
@@ -71,8 +70,12 @@ public:
|
|||||||
if (fPort < B_OK)
|
if (fPort < B_OK)
|
||||||
return fPort;
|
return fPort;
|
||||||
|
|
||||||
// Create Thread
|
#ifdef KERNEL_LAND
|
||||||
|
// if this is the case you better stay with kernel
|
||||||
|
set_port_owner(fPort, 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Create Thread
|
||||||
fThread = find_thread(fThreadName);
|
fThread = find_thread(fThreadName);
|
||||||
if (fThread < B_OK) {
|
if (fThread < B_OK) {
|
||||||
#ifdef KERNEL_LAND
|
#ifdef KERNEL_LAND
|
||||||
@@ -162,8 +165,19 @@ private:
|
|||||||
|
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG_PORTLISTENER
|
||||||
|
#ifdef KERNEL_LAND
|
||||||
|
dprintf("Error in PortListener handler=%s port=%s\n", strerror(status),
|
||||||
|
strerror(ssizePort));
|
||||||
|
#else
|
||||||
|
printf("Error in PortListener handler=%s port=%s\n", strerror(status),
|
||||||
|
strerror(ssizePort));
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
free(buffer);
|
free(buffer);
|
||||||
|
|
||||||
if (ssizePort == B_BAD_PORT_ID) // the port disappeared
|
if (ssizePort == B_BAD_PORT_ID) // the port disappeared
|
||||||
|
|||||||
Reference in New Issue
Block a user