| 59 | #define unlock_internal(internal) mutex_unlock(&internal->mutex) |
| 60 | |
| 61 | error_t device_construct(Device* device) { |
| 62 | device->internal = new(std::nothrow) DeviceInternal; |
| 63 | if (device->internal == nullptr) { |
| 64 | return ERROR_OUT_OF_MEMORY; |
| 65 | } |
| 66 | LOG_D(TAG, "construct %s", device->name); |
| 67 | mutex_construct(&device->internal->mutex); |
| 68 | return ERROR_NONE; |
| 69 | } |
| 70 | |
| 71 | error_t device_destruct(Device* device) { |
| 72 | lock_internal(device->internal); |
no test coverage detected