The solution to (nicely) restarting a W3 server with threads in mount
point handlers or dynamically changing/removing an active BGI mount
point in an OS independent manner is relatively straight forward.
Presumably there is a table in the server providing a mapping between
mount points and function pointers. For each mount point handler, keep
two additional pieces of information, a state variable and a reference
count. When a BGI handler is successfully initialized, set the ref
count to zero and the state to active. In addition, keep a ref count
on the whole table and initialize it to zero.
When a mount handler is called, increment the handler reference count
and the table ref count. When the handler returns, decrement the ref counts.
When a mount point is deleted or changed, set the state to inactive.
All subsequent searches for this mount point will see the state is
inactive and ignore this entry and either go on to find its replacement
or fail and notify the client.
When a mount point's ref count goes to zero and the state is inactive,
do the appropriate cleanup (unmount, unload of entry point, remove from
table etc.).
To stop or restart the server falls out from the above architecture.
Set all of the entries in the mount point table to inactive and wait
for the table ref count to go to zero.
The above data structures of course need to be thread protected.
Simon, do you have any target dates for the BGI spec?