Menu

#791 Wrong usage of omni_mutex_lock in some files

closed
None
C++ API
5
2017-01-06
2016-04-14
No

Hi,

There are calls to omni_mutex_lock() without the creation of a variable in files of the cpp api.
This makes these calls useless and does not protect the area the lock was supposed to protect.

For instance, in devasyn.h, the following line in UniqIdent class:
size_t get_request_nb() {omni_mutex_lock(*this);return asynpollreqtable.size();}
should be replaced with something like:
size_t get_request_nb() {omni_mutex_lock sync(*this);return asyn_poll_req_table.size();}

The following files are affected by this issue:

  • client/devasyn.h
  • client/cbthread.h
  • client/asynreq.cpp
  • server/pollobj.h
  • server/pollobj.h

Cheers,
Reynald

Discussion

  • Bourtembourg Reynald

    • Status: open --> closed
     

Log in to post a comment.