> put a lock in these individual elements

The only way to attach a lock to a memory space, that I know, is to add a 
pragma in a variable declaration:
    
    
    var num {.guard: lock}: int
    
    
    Run

How can i use them on dynamically allocated items ?

Reply via email to