Module em_mocking_queue

Internal mutex process to serialize the access to modules being loaded by concurrent tests.

Copyright © (C) 2011, 2014 Sven Heyll

Behaviours: gen_server.

Authors: Sven Heyll (sven.heyll@gmail.com).

Description

Internal mutex process to serialize the access to modules being loaded by concurrent tests. There is an inherent race condition between checking if the module attribute ERLYMOCK_COMPILED is already set on a module and then loading that module, which can only be resolved by atomically checking and locking the module(s) being overwritten.

Function Index

enqueue_and_wait/2 Checks for the ERLYMOCK_COMPILED module attribute on the given modules and marks the modules as "locked".
handle_cast/2
lock_immediately/2 Atomically lock a global record on any module.

Function Details

enqueue_and_wait/2

enqueue_and_wait(MockPid::pid(), Mods::[module()]) -> ok

Checks for the ERLYMOCK_COMPILED module attribute on the given modules and marks the modules as "locked".

handle_cast/2

handle_cast(Request, State) -> any()

lock_immediately/2

lock_immediately(MockPid::pid(), Mods::[module()]) -> ok

Atomically lock a global record on any module


Generated by EDoc