Previous: , Up: Package Locks   [Contents][Index]

2.5.2 Disabling package locks

A package’s locks can be enabled or disabled by using the ext:package-lock and ext:package-definition-lock accessors, as follows:

   (setf (ext:package-lock (find-package "UNIX")) nil)
   (setf (ext:package-definition-lock (find-package "UNIX")) nil)
Function: ext:package-lock package

This function is an accessor for a package’s structural lock, which protects it against modifications to its list of exported symbols.

Function: ext:package-definition-lock package

This function is an accessor for a package’s definition-lock, which protects symbols in that package from redefinition. As well as protecting the symbol’s fdefinition from change, attempts to change the symbol’s definition using defstruct, defclass or deftype will be trapped.

Macro: ext:without-package-locks &rest body

This macro can be used to execute forms with all package locks (both structure and definition locks) disabled.

Function: ext:unlock-all-packages

This function disables both structure and definition locks on all currently defined packages. Note that package locks are reset when CMUCL is restarted, so the effect of this function is limited to the current session.