Trac #9878: Use a mutex to protect the spt.