Changeset 14155


Ignore:
Timestamp:
Aug 7, 2010, 7:31:17 AM (9 years ago)
Author:
gb
Message:

Add a PROCESS arg to OPEN-SHARED-LIBRARY, whose value can be :INITIAL,
:CURRENT, or a PROCESS object. If :INITIAL, do the open on the initial
process; if :CURRENT, do it in the current process, else do it in the
specified process. Defaults to :INITIAL on OSX, to :CURRENT (the status
quo) on other platforms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/l0-cfm-support.lisp

    r14119 r14155  
    311311                     
    312312
    313 (defun open-shared-library (name)
    314   "If the library denoted by name can be loaded by the operating system,
    315 return an object of type SHLIB that describes the library; if the library
    316 is already open, increment a reference count. If the library can't be
    317 loaded, signal a SIMPLE-ERROR which contains an often-cryptic message from
    318 the operating system."
     313(defun open-shared-library-internal (name)
    319314  (let* ((handle (with-cstrs ((name name))
    320315                        (ff-call
     
    401396
    402397
    403 (defun open-shared-library (name)
    404   "If the library denoted by name can be loaded by the operating system,
    405 return an object of type SHLIB that describes the library; if the library
    406 is already open, increment a reference count. If the library can't be
    407 loaded, signal a SIMPLE-ERROR which contains an often-cryptic message from
    408 the operating system."
     398(defun open-shared-library-internal (name)
    409399  (rlet ((type :signed))
    410400    (let ((result (with-cstrs ((cname name))
     
    589579
    590580
    591   (defun open-shared-library (name)
    592     "If the library denoted by name can be loaded by the operating system,
    593 return an object of type SHLIB that describes the library; if the library
    594 is already open, increment a reference count. If the library can't be
    595 loaded, signal a SIMPLE-ERROR which contains an often-cryptic message from
    596 the operating system."
     581  (defun open-shared-library-internal (name)
    597582    (let* ((hmodule (with-cstrs ((name name))
    598583                      (ff-call
     
    990975              *fvs*))))
    991976
    992 
     977(defun open-shared-library (name &optional (process #+darwin-target :initial
     978                                                    #-darwin-target :current))
     979  "If the library denoted by name can be loaded by the operating system,
     980return an object of type SHLIB that describes the library; if the library
     981is already open, increment a reference count. If the library can't be
     982loaded, signal a SIMPLE-ERROR which contains an often-cryptic message from
     983the operating system."
     984  (if (or (eq process :current)
     985          (eq process *current-process*)
     986          (and (eq process :initial)
     987               (eq *current-process* *initial-process*)))
     988    (open-shared-library-internal name)
     989    (call-in-process (lambda () (open-shared-library name))
     990                     (if (eq process :initial)
     991                       *initial-process*
     992                       process))))
     993
     994
Note: See TracChangeset for help on using the changeset viewer.