NordicSemiconductor / pc-ble-driver-js

Node.js interface to the C/C++ pc-ble-driver library. API docs: https://nordicsemiconductor.github.io/pc-ble-driver-js/
Other
79 stars 41 forks source link

Possible race condition issue in h5_transport #18

Closed rosek86 closed 8 years ago

rosek86 commented 8 years ago

Hi,

Occasionally the application doesn't change state from STATE_START to STATE_RESET. I think the reason is that the _exitCriterias->isOpened is set to true before state machine is executed:

https://github.com/NordicSemiconductor/pc-ble-driver-js/blob/master/driver/src/transport/h5_transport.cpp#L136

If this is the case, the exit->reset() clears isOpened flag and application stucks in "while (!exit->isFullfilled())" loop.

https://github.com/NordicSemiconductor/pc-ble-driver-js/blob/master/driver/src/transport/h5_transport.cpp#L434

BR, Krzysztof

bihanssen commented 8 years ago

Thanks for the detailed observation, we'll check it out.

rosek86 commented 8 years ago

I think this was related to my issue with Intel Edison #22, which is now solved. Thanks!