Opened 19 years ago

Closed 19 years ago

#1223 closed defect (fixed)

call msThreadInit in msSetup for use with mapscript initialization

Reported by: sgillies@… Owned by: sgillies@…
Priority: high Milestone:
Component: MapServer C Library Version: 4.4
Severity: normal Keywords:
Cc: jerry.pisk@…

Description

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

Change History (2)

comment:1 by sgillies@…, 19 years ago

Status: newassigned
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.


comment:2 by sgillies@…, 19 years ago

Resolution: fixed
Status: assignedclosed
I decided not to commit this to the 4.4 branch after all.

Note: See TracTickets for help on using tickets.