PreviousUpNext

15.4.978  src/lib/src/quickstring.pkg

## quickstring.pkg

# Compiled by:
#     src/lib/std/standard.lib



# Thread-safe version of Quickstring,
# protecting the global hashtable with a lock.


package quickstring: (weak)  Quickstring {                      # Quickstring                   is from   src/lib/src/quickstring.api
    #
    include package   threadkit;                                # threadkit                     is from   src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkg

    include package   quickstring__premicrothread;              # quickstring__premicrothread   is from   src/lib/src/quickstring--premicrothread.pkg

    stipulate
        #
        lock = make_full_maildrop ();
        #
    herein

        fun atomically f a
            =
            {   take_from_maildrop lock;
                #
                f a
                then
                    put_in_maildrop (lock, ());
            };
    end;

    from_string    =  atomically  from_string;
    from_substring =  atomically  from_substring;
};


## Author: Matthias Blume (blume@tti-c.org)
## Copyright (c) 2005 by The Fellowship of SML/NJ
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext