mirror of
https://github.com/monero-project/monero.git
synced 2025-05-11 18:35:05 -04:00
Change mutex lock model to avoid dead lock and ensure locks are always released.
Additional cosmetic fixes: move 'name' as protected remove unnecessary local var Fix debug log
This commit is contained in:
parent
641dfc991f
commit
100b7bc10d
5 changed files with 202 additions and 385 deletions
|
@ -78,8 +78,10 @@ namespace hw {
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
class device {
|
||||
protected:
|
||||
std::string name;
|
||||
|
||||
public:
|
||||
|
||||
device() {}
|
||||
|
@ -92,8 +94,6 @@ namespace hw {
|
|||
static const int SIGNATURE_FAKE = 1;
|
||||
|
||||
|
||||
std::string name;
|
||||
|
||||
/* ======================================================================= */
|
||||
/* SETUP/TEARDOWN */
|
||||
/* ======================================================================= */
|
||||
|
@ -104,7 +104,15 @@ namespace hw {
|
|||
virtual bool release() = 0;
|
||||
|
||||
virtual bool connect(void) = 0;
|
||||
virtual bool disconnect() = 0;
|
||||
virtual bool disconnect(void) = 0;
|
||||
|
||||
/* ======================================================================= */
|
||||
/* LOCKER */
|
||||
/* ======================================================================= */
|
||||
virtual void lock(void) = 0;
|
||||
virtual void unlock(void) = 0;
|
||||
virtual bool try_lock(void) = 0;
|
||||
|
||||
|
||||
/* ======================================================================= */
|
||||
/* WALLET & ADDRESS */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue