MapServer / MapServer-import

3 stars 2 forks source link

call msThreadInit in msSetup for use with mapscript initialization #1223

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: sgillies@frii.com Date: 2005/02/08 - 18:13

jerryp  seang: could you please add call to msThreadInit() surrounded by #ifdef
USE_THREAD to msSetup? If it's not called before threads are started it exposes
a race condition...
jerryp  I think
jerryp  it does, both on Windows and pthreads
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2005/02/08 - 18:43

Jerry, I changed the module initialization code to the following.  It
definitely gets called when importing the Python module.  If it doesn't work
for Java, lemme know:

/*
============================================================================
 Module initialization
============================================================================
*/

/* See bug 1203 for discussion of race condition with GD font cache */
%init %{
    if (msSetup() != MS_SUCCESS)
    {
        msSetError(MS_MISCERR, "Failed to set up threads and font cache",
                   "msSetup()");
    }
%}

Commits made to CVS HEAD, and to branch-4-4 after more testing on Java and
Python platforms.
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2005/02/21 - 18:47

I decided not to commit this to the 4.4 branch after all.