Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#25831: refactor: Remove trailing semicolon from…
Browse files Browse the repository at this point in the history
… LOCK2 macro

0f0cc05 refactor: Remove trailing semicolon from LOCK2 (Aurèle Oulès)

Pull request description:

  Macros should not have a trailing semi-colon to avoid empty statements when using them with another semi-colon.
  Noticed this while reviewing a PR.

ACKs for top commit:
  vasild:
    ACK 0f0cc05

Tree-SHA512: 97fa4d89f5131ac30e05b293f750b757d5526feed56885c6feeb403b3ac3d3d3205874bc507c3b56a8296a6e3bdc8d879b2c339784f1e6ab1963d1b8a8d7b02f
  • Loading branch information
MacroFake committed Sep 14, 2022
2 parents 13fd9ee + 0f0cc05 commit a8c3590
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ inline RecursiveMutex* MaybeCheckNotHeld(RecursiveMutex* cs) LOCKS_EXCLUDED(cs)
#define LOCK(cs) DebugLock<decltype(cs)> UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
#define LOCK2(cs1, cs2) \
DebugLock<decltype(cs1)> criticalblock1(MaybeCheckNotHeld(cs1), #cs1, __FILE__, __LINE__); \
DebugLock<decltype(cs2)> criticalblock2(MaybeCheckNotHeld(cs2), #cs2, __FILE__, __LINE__);
DebugLock<decltype(cs2)> criticalblock2(MaybeCheckNotHeld(cs2), #cs2, __FILE__, __LINE__)
#define TRY_LOCK(cs, name) DebugLock<decltype(cs)> name(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__, true)
#define WAIT_LOCK(cs, name) DebugLock<decltype(cs)> name(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)

Expand Down

0 comments on commit a8c3590

Please sign in to comment.