--- tme/generic/bus-device.c 2018/04/24 16:39:45 1.1.1.3 +++ tme/generic/bus-device.c 2018/04/24 16:41:10 1.1.1.4 @@ -1,4 +1,4 @@ -/* $Id: bus-device.c,v 1.1.1.3 2018/04/24 16:39:45 root Exp $ */ +/* $Id: bus-device.c,v 1.1.1.4 2018/04/24 16:41:10 root Exp $ */ /* generic/bus-device.c - implementation of a generic bus device support: */ @@ -34,7 +34,7 @@ */ #include -_TME_RCSID("$Id: bus-device.c,v 1.1.1.3 2018/04/24 16:39:45 root Exp $"); +_TME_RCSID("$Id: bus-device.c,v 1.1.1.4 2018/04/24 16:41:10 root Exp $"); /* includes: */ #include @@ -60,8 +60,10 @@ tme_bus_device_connection_score(struct t /* a simple bus device can have multiple connections, but they all must be from the same bus. the only way we check that is by comparing elements: */ - conn_bus_other_old = TME_ATOMIC_READ(struct tme_bus_connection *, - device->tme_bus_device_connection); + conn_bus_other_old + = tme_memory_atomic_pointer_read(struct tme_bus_connection *, + device->tme_bus_device_connection, + &device->tme_bus_device_connection_rwlock); conn_bus_other_new = (struct tme_bus_connection *) conn->tme_connection_other; if (conn_bus_other_old != NULL && (conn_bus_other_old->tme_bus_connection.tme_connection_element @@ -98,9 +100,10 @@ tme_bus_device_connection_make(struct tm if (state == TME_CONNECTION_FULL) { /* save our connection: */ - TME_ATOMIC_WRITE(struct tme_bus_connection *, - device->tme_bus_device_connection, - (struct tme_bus_connection *) conn->tme_connection_other); + tme_memory_atomic_pointer_write(struct tme_bus_connection *, + device->tme_bus_device_connection, + (struct tme_bus_connection *) conn->tme_connection_other, + &device->tme_bus_device_connection_rwlock); } return (TME_OK);