updated some locking related comments.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20613 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -56,7 +56,6 @@ device_reader_thread(void *_interface)
|
|||||||
//dprintf("received buffer of %ld bytes length\n", buffer->size);
|
//dprintf("received buffer of %ld bytes length\n", buffer->size);
|
||||||
|
|
||||||
// feed device monitors
|
// feed device monitors
|
||||||
// TODO: locking!
|
|
||||||
DeviceMonitorList::Iterator iterator
|
DeviceMonitorList::Iterator iterator
|
||||||
= interface->monitor_funcs.GetIterator();
|
= interface->monitor_funcs.GetIterator();
|
||||||
while (iterator.HasNext()) {
|
while (iterator.HasNext()) {
|
||||||
@@ -67,7 +66,6 @@ device_reader_thread(void *_interface)
|
|||||||
int32 type = interface->deframe_func(device, buffer);
|
int32 type = interface->deframe_func(device, buffer);
|
||||||
if (type >= 0) {
|
if (type >= 0) {
|
||||||
// find handler for this packet
|
// find handler for this packet
|
||||||
// TODO: locking!
|
|
||||||
DeviceHandlerList::Iterator iterator
|
DeviceHandlerList::Iterator iterator
|
||||||
= interface->receive_funcs.GetIterator();
|
= interface->receive_funcs.GetIterator();
|
||||||
status = B_ERROR;
|
status = B_ERROR;
|
||||||
@@ -470,8 +468,12 @@ interface_protocol_send_data(net_datalink_protocol *_protocol,
|
|||||||
interface_protocol *protocol = (interface_protocol *)_protocol;
|
interface_protocol *protocol = (interface_protocol *)_protocol;
|
||||||
net_interface_private *interface = (net_interface_private *)protocol->interface;
|
net_interface_private *interface = (net_interface_private *)protocol->interface;
|
||||||
|
|
||||||
// feed device monitors
|
// TODO: Need to think about this locking. We can't obtain the
|
||||||
// TODO: locking!
|
// RX Lock here (nor would it make sense) as the ARP
|
||||||
|
// module calls send_data() with it's lock held (similiar
|
||||||
|
// to the domain lock, which would violate the locking
|
||||||
|
// protocol).
|
||||||
|
|
||||||
DeviceMonitorList::Iterator iterator =
|
DeviceMonitorList::Iterator iterator =
|
||||||
interface->device_interface->monitor_funcs.GetIterator();
|
interface->device_interface->monitor_funcs.GetIterator();
|
||||||
while (iterator.HasNext()) {
|
while (iterator.HasNext()) {
|
||||||
@@ -491,7 +493,7 @@ interface_protocol_up(net_datalink_protocol *_protocol)
|
|||||||
((net_interface_private *)protocol->interface)->device_interface;
|
((net_interface_private *)protocol->interface)->device_interface;
|
||||||
net_device *device = protocol->device;
|
net_device *device = protocol->device;
|
||||||
|
|
||||||
// TODO: locking!
|
// This function is called with the RX lock held.
|
||||||
|
|
||||||
if (deviceInterface->up_count != 0) {
|
if (deviceInterface->up_count != 0) {
|
||||||
deviceInterface->up_count++;
|
deviceInterface->up_count++;
|
||||||
@@ -526,7 +528,7 @@ interface_protocol_down(net_datalink_protocol *_protocol)
|
|||||||
net_device_interface *deviceInterface =
|
net_device_interface *deviceInterface =
|
||||||
((net_interface_private *)protocol->interface)->device_interface;
|
((net_interface_private *)protocol->interface)->device_interface;
|
||||||
|
|
||||||
// TODO: locking!
|
// This function is called with the RX lock held.
|
||||||
if (deviceInterface->up_count == 0)
|
if (deviceInterface->up_count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user