How can i wrap a function in c# same as using inline header function in C
<p>I am writing some class in c# that have a function </p>

<pre><code>Print(string s)
</code></pre>

<p>In the last version i found out that this function called from many threads and every time this function called it should be locked. In C language i can rename this function to </p>

<pre><code>PrintA(string s) 
</code></pre>

<p>and change the header file to something like</p>

<pre><code>#define Print(a) {Lock(PrintA) //
                  { //
                      PrintA(a) //
                  } //
                 } 
</code></pre>

<p>Is it possible to write something like this in C#?
I just want to change one place instead multiple place all over the code.</p>
