+(defun unload-shared-object (pathname)
+ #!+sb-doc
+ "Unloads the shared object loaded earlier using the designated PATHNAME with
+LOAD-SHARED-OBJECT, to the degree supported on the platform.
+
+Experimental."
+ (let ((pathname (pathname pathname)))
+ (sb!thread:with-mutex (*shared-objects-lock*)
+ (let ((old (find pathname *shared-objects*
+ :key #'shared-object-pathname
+ :test #'equal)))
+ (when old
+ (dlclose-or-lose old)
+ (setf *shared-objects* (remove old *shared-objects*))
+ #!+(and linkage-table (not win32))
+ (update-linkage-table))))))
+