title: How to define thread safe array?
body: <p>How can I define a thread safe global array with minimal modifications?</p>
  
  <p>I want like every access to it to be accomplished by using mutex and synchronized block.</p>
  
  <p>Something like this as 'T' will be some type (note that 'sync' keyword is not currently defined AFAIK):</p>
  
  <pre><code>sync Array!(T) syncvar;
  </code></pre>
  
  <p>And every access to it will be simmilar to this:</p>
  
  <pre><code>Mutex __syncvar_mutex;
  
      //some func scope....
      synchronized(__syncvar_mutex) { /* edits 'syncvar' safely */ }
  </code></pre>