[Haiku-commits] r31016 - haiku/trunk/headers/private/bluetooth
oruizdorantes at BerliOS
oruizdorantes at mail.berlios.de
Fri Jun 12 20:25:57 CEST 2009
Author: oruizdorantes
Date: 2009-06-12 20:25:57 +0200 (Fri, 12 Jun 2009)
New Revision: 31016
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31016&view=rev
Modified:
haiku/trunk/headers/private/bluetooth/PortListener.h
Log:
License header & style
Modified: haiku/trunk/headers/private/bluetooth/PortListener.h
===================================================================
--- haiku/trunk/headers/private/bluetooth/PortListener.h 2009-06-12 18:14:51 UTC (rev 31015)
+++ haiku/trunk/headers/private/bluetooth/PortListener.h 2009-06-12 18:25:57 UTC (rev 31016)
@@ -1,3 +1,7 @@
+/*
+ * Copyright 2009 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
+ * All rights reserved. Distributed under the terms of the MIT License.
+ */
#ifndef PORTLISTENER_H_
#define PORTLISTENER_H_
@@ -6,7 +10,7 @@
template <
typename TYPE,
- ssize_t MAX_MESSAGE_SIZE = 256,
+ ssize_t MAX_MESSAGE_SIZE = 256,
size_t MAX_MESSAGE_DEEP = 16,
uint32 PRIORITY = B_URGENT_DISPLAY_PRIORITY>
class PortListener {
@@ -18,13 +22,12 @@
port_listener_func func;
} fInformation;
-
- public:
+ public:
PortListener(const char* name, port_listener_func handler)
{
fInformation.func = handler;
fInformation.port = &fPort;
-
+
InitCheck();
fPortName = strdup(name);
fThreadName = strdup(name);
@@ -48,9 +51,9 @@
status_t TriggerCode(int32 code) {
-
+
return write_port(fPort, code, NULL, 0);
-
+
}
@@ -77,10 +80,10 @@
MAX_MESSAGE_DEEP, PRIORITY>::threadFunction, fThreadName, PRIORITY, &fInformation);
#endif
}
-
+
if (fThread < B_OK)
return fThread;
-
+
return B_OK;
}
@@ -97,6 +100,7 @@
status_t Stop() {
+
status_t status;
wait_for_thread(fThread, &status);
More information about the Haiku-commits
mailing list