sant.tarun@gmail.com wrote:
Quote:
Hi,
I am facing some some problem in restricting the access of a
variable....
My question is described below.....
>
Let I have two different C source files 'a.c' and 'b.c'.
>
In the file 'a.c' there is a global variable declared 'int
GlobalVariable' and the same variable is extern in the file 'b.c'.
>
a.c b.c
----------------------- ---------------------------
|int Globalvariable; | |extern int Globalvariable;
|int main() | |
|{ | |Other funtions
|...... | |{
|} | |......
| | |}
|---------------------- ----------------------------
>
Now I want to restrict the access of that variable "Globalvariable" in
the file 'b.c' without using any semaphore.
What do you mean by "restrict the access"? Be more precise and we may be
able to help.
As you are talking about semaphores, are you implying you want to
enforce some form of serialization of access (perhaps by multiple
threads)?