The cl-package-locks Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-package-locks Reference Manual

This is the cl-package-locks Reference Manual, version 0.0.2, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 08:13:08 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

= cl-package-locks overview =

This library aims to provide a uniform way of dealing with 
package-locks across those common lisp implementations that
provide them.  If a given implementation does not provide a 
package-lock mechanism then no action will be taken by the 
use of this library.

= Motivation =

In loading LISA I noticed a package lock violation during 
compilation.  I was interested in correcting the violation 
since I assume it's the reason the package isn't included 
in quicklisp, etc.  

I found the package lock violation was due to a class reader 
function being named CLASS-NAME, which would add a method to 
the package-lock protected CLASS-NAME generic-function.

I thought about modifing the name of the function, but then 
realized that the LISA has been around a while and how altering
the name might cause compatability issues (however small).

So I decided I'd hack in some code to disable the package-lock
and after dealing with sbcl, cmucl, AllegroCL.. I realized this
might be better suited for a general purpose library, so I 
created this small lib to accomplish the task.

In doing some early research to see if others had delt with this
issue I discovered this thread:

  http://coding.derkeiler.com/Archive/Lisp/comp.lang.lisp/2009-02/msg01372.html

This library distinguishes itself from the above by not trying
to eleminiate redefinition warnings or use the native
without-package-locks macro's provided by most package-locking
implementations.  It also provides some general use functions
and macros that might be useful in dealing with package locking.

I find this library to satisfy my needs with loading LISA and I
hope it suits others in their moments of package-lock violation 
need :)

= Status =

Barely coded and tested using sbcl.  Needs more testing on 
AllegroCL, clisp, and cmucl.  I'm also interested in creating 
a uniform way of dealing with package-lock errors and providing 
implementation agnostic restarts.  Another important piece is 
looking at how the various implementations implement 
without-package-locks to see if I'm missing anything important .

= A Brief HowTo =

(in-package :cl-package-locks)

; Testing if packages are locked
(package-locked-p :cl-user)

; Locking a package
(lock-package (find-package :cl-user))

; Unlocking a package, notice that packages can be described 
; in several different ways (currently symbol & package).
(unlock-package 'cl-user)

; Working on lists of packages.  The RESOLVE-PACKAGES function
; converts a list of package descriptors to packages or errors.
(let ((pkgs (resolve-packages '(:cl-package-locks :swank))))
  (lock-packages pkgs)
  ; your code here
  (unlock-packages))

; Temporarily unlocking a list of packages
(with-packages-unlocked (cl mop)
  ; something dangerous
  t)

; Temporarily unlock all packages
(without-package-locks
  ; something dangerous
  nil)

; List all unlocked packages
(all-unlocked-packages)

; List all locked packages
(all-locked-packages)


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-package-locks

Author

Elliott Johnson <elliott@elliottjohnson.net>

License

Copyright 2011 Elliott Johnson

Description

A library to provide a unified way to work with package locks across supported common lisp implementations.

Version

0.0.2

Source

cl-package-locks.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cl-package-locks.asd

Location

cl-package-locks.asd

Systems

cl-package-locks (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cl-package-locks/package.lisp

Parent

cl-package-locks (system)

Location

package.lisp

Packages

cl-package-locks


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 cl-package-locks/cl-package-locks.lisp

Dependency

package.lisp (file)

Parent

cl-package-locks (system)

Location

cl-package-locks.lisp

Exported Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 cl-package-locks

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Macros

Macro: with-packages-unlocked PACKAGES &body BODY

Accepts a list of packages that be unlocked for the duration of BODY and locked upon return.

Package

cl-package-locks

Source

cl-package-locks.lisp (file)

Macro: without-package-locks &body BODY

Unlocks all packages for the duration of body.

Package

cl-package-locks

Source

cl-package-locks.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: all-locked-packages ()

Returns a list of all locked packages.

Package

cl-package-locks

Source

cl-package-locks.lisp (file)

Function: all-unlocked-packages ()

Returns a list of all unlocked packages.

Package

cl-package-locks

Source

cl-package-locks.lisp (file)

Function: lock-package PACKAGE

Locks a provided package.

Package

cl-package-locks

Source

cl-package-locks.lisp (file)

Function: lock-packages PACKAGES

Locks the provided packages.

Package

cl-package-locks

Source

cl-package-locks.lisp (file)

Function: locked-packages PACKAGES

Accepts a list of packages and returns those that are locked.

Package

cl-package-locks

Source

cl-package-locks.lisp (file)

Function: package-locked-p PACKAGE

Returns true if a given resolveable PACKAGE is locked.

Package

cl-package-locks

Source

cl-package-locks.lisp (file)

Function: resolve-package PACKAGE

Resolves a descriptor to a package object.

Package

cl-package-locks

Source

cl-package-locks.lisp (file)

Function: resolve-packages PACKAGES

Resolves a list of packages.

Package

cl-package-locks

Source

cl-package-locks.lisp (file)

Function: unlock-package PACKAGE

Unlocks a provided package.

Package

cl-package-locks

Source

cl-package-locks.lisp (file)

Function: unlock-packages PACKAGES

Unlocks the provided packages.

Package

cl-package-locks

Source

cl-package-locks.lisp (file)

Function: unlocked-packages PACKAGES

Accepts a list of packages and returns those that are unlocked.

Package

cl-package-locks

Source

cl-package-locks.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-package-locks.asd: The cl-package-locks<dot>asd file
cl-package-locks/cl-package-locks.lisp: The cl-package-locks/cl-package-locks<dot>lisp file
cl-package-locks/package.lisp: The cl-package-locks/package<dot>lisp file

F
File, Lisp, cl-package-locks.asd: The cl-package-locks<dot>asd file
File, Lisp, cl-package-locks/cl-package-locks.lisp: The cl-package-locks/cl-package-locks<dot>lisp file
File, Lisp, cl-package-locks/package.lisp: The cl-package-locks/package<dot>lisp file

L
Lisp File, cl-package-locks.asd: The cl-package-locks<dot>asd file
Lisp File, cl-package-locks/cl-package-locks.lisp: The cl-package-locks/cl-package-locks<dot>lisp file
Lisp File, cl-package-locks/package.lisp: The cl-package-locks/package<dot>lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   A   F   L   M   P   R   U   W  
Index Entry  Section

A
all-locked-packages: Exported functions
all-unlocked-packages: Exported functions

F
Function, all-locked-packages: Exported functions
Function, all-unlocked-packages: Exported functions
Function, lock-package: Exported functions
Function, lock-packages: Exported functions
Function, locked-packages: Exported functions
Function, package-locked-p: Exported functions
Function, resolve-package: Exported functions
Function, resolve-packages: Exported functions
Function, unlock-package: Exported functions
Function, unlock-packages: Exported functions
Function, unlocked-packages: Exported functions

L
lock-package: Exported functions
lock-packages: Exported functions
locked-packages: Exported functions

M
Macro, with-packages-unlocked: Exported macros
Macro, without-package-locks: Exported macros

P
package-locked-p: Exported functions

R
resolve-package: Exported functions
resolve-packages: Exported functions

U
unlock-package: Exported functions
unlock-packages: Exported functions
unlocked-packages: Exported functions

W
with-packages-unlocked: Exported macros
without-package-locks: Exported macros

Jump to:   A   F   L   M   P   R   U   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables


Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-package-locks: The cl-package-locks system
cl-package-locks: The cl-package-locks package

P
Package, cl-package-locks: The cl-package-locks package

S
System, cl-package-locks: The cl-package-locks system

Jump to:   C   P   S