Bitcoin Forum
May 25, 2024, 10:46:08 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Small questions about source code  (Read 355 times)
jodicksons (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 1


View Profile
June 25, 2017, 03:59:11 PM
Merited by ABCbits (1)
 #1

Hello everyone, I am currently going through the bitcoin source code and each of the functions etc..

I would like to know more about the LOCK() function.

I see a lot of them and while using my search function, can't seem to find it's origin.

I know it is about threads and "locking access" to certain vars but would like to read how it is implemented.

If anybody know where to find the definition of the LOCK or CRITICAL_BLOCK function, it would be greatly appreciated.

example :

 LOCK(csPathCached);
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3402
Merit: 6653


Just writing some code


View Profile WWW
June 25, 2017, 05:23:05 PM
 #2

Those are actually macros, not functions. They are defined here: https://github.com/bitcoin/bitcoin/blob/master/src/sync.h

jodicksons (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 1


View Profile
June 25, 2017, 06:12:21 PM
 #3

Thank you.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!