Mutex declaration for Linux
I figured out how to get rid of the static instantiation of the mutexes using pthreads.
For pthread.h to define the necessary symbols _GNU_SOURCE needs to be declared. Probably easiest to add -D_GNU_SOURCE to the COPTS in the makefiles. While editing the makefiles adding -DLUCLIN is also a good idea.
Then, the code commented out above the current static assignment can be uncommented, and the static initialization can be removed.
While unclear if it has any beneficial effects, the world server still works properly (as properly as I've seen it work on linux that is) after these changes and a few others I had to made to get it to build.
Attached is the code & makefile from world as an example of the changes to the makefile & code. They also include a few of the other changes I've made. It also appears that console.cpp wasn't initializing the mutex referenced throughout the code so that change is in here as well.
Hope this is useful...
|