Analizo
view release on metacpan or search on metacpan
lib/Analizo/Batch/Job.pm view on Meta::CPAN
47484950515253545556575859606162636465666768697071sub
cleanup {
}
# When this method is called, the job must activate its mode for safe parallel
# processing. When such mode is activated, the job must be prepared, executed
# and cleaned in a way that it is possible to process several jobs in parallel.
# This means for example that if any change is required in the directory where
# the job will run, the job must first make copy of that directory and operate
# over it instead of operating over the original directory.
#
# Analizo's parallelism model uses separate PROCESSES and not separate threads.
# This is due to the fact that to process some jobs, Analizo will need to
# chdir() into different directories, and if we used threads this would cause
# problems since the current work directory is shared by all threads, and
# therefore one thread would interfere with the others when using chdir().
#
# This method must be inherited by subclasses.
#
# When called, it will be called BEFORE the B<prepare> method. After the first
# job has its B<parallel_prepare> method called, any subsequent invocations of
# this method on jobs in the same process must be indepotent.
sub
parallel_prepare {
}
# This method must cleanup any resources that may have been created to support
t/samples/android-framework/android-5.1.1_r38/AudioTrackShared.cpp view on Meta::CPAN
729730731732733734735736737738739740741742743744745746747748749
// the acquire might not be necessary since not doing a subsequent
read
int32_t rear = android_atomic_acquire_load(
&cblk
->u.mStreaming.mRear);
ssize_t filled = rear - cblk->u.mStreaming.mFront;
//
pipe
should not already be overfull
if
(!(0 <= filled && (size_t) filled <= mFrameCount)) {
ALOGE(
"Shared memory control block is corrupt (filled=%zd); shutting down"
, filled);
mIsShutdown = true;
return
0;
}
// and racy
if
called by normal mixer thread
// ignores flush(), so framesReady() may report a larger mFrameCount than obtainBuffer()
return
filled;
}
bool AudioTrackServerProxy::setStreamEndDone() {
audio_track_cblk_t* cblk = mCblk;
bool old =
(android_atomic_or(CBLK_STREAM_END_DONE,
&cblk
->mFlags) & CBLK_STREAM_END_DONE) != 0;
if
(!old) {
(void)
syscall
(__NR_futex,
&cblk
->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE,
t/samples/android-framework/android-5.1.1_r38/AudioTrackShared.cpp view on Meta::CPAN
775776777778779780781782783784785786787788789790791792793794795
mState.mLoopCount = 0;
}
void StaticAudioTrackServerProxy::framesReadyIsCalledByMultipleThreads()
{
mFramesReadyIsCalledByMultipleThreads = true;
}
size_t StaticAudioTrackServerProxy::framesReady()
{
// Can't call pollPosition() from multiple threads.
if
(!mFramesReadyIsCalledByMultipleThreads) {
(void) pollPosition();
}
return
mFramesReadySafe;
}
ssize_t StaticAudioTrackServerProxy::pollPosition()
{
size_t position = mPosition;
StaticAudioTrackState state;
t/samples/httpd-2.4.38/mod_suexec.c view on Meta::CPAN
132133134135136137138139140141142143144145146147148149150151152}
#undef SUEXEC_POST_CONFIG_USERDATA
/*
* Define the directives specific to this module. This structure is referenced
* later by the
'module'
structure.
*/
static const command_rec suexec_cmds[] =
{
/* XXX - Another important reason not to allow this in .htaccess is that
* the ap_[ug]name2id() is not thread-safe */
AP_INIT_TAKE2(
"SuexecUserGroup"
, set_suexec_ugid, NULL, RSRC_CONF,
"User and group for spawned processes"
),
{ NULL }
};
static void suexec_hooks(apr_pool_t
*p
)
{
ap_hook_get_suexec_identity(get_suexec_id_doer,NULL,NULL,APR_HOOK_MIDDLE);
ap_hook_post_config(suexec_post_config,NULL,NULL,APR_HOOK_MIDDLE);
}
t/samples/multiple_inheritance/java/README.md view on Meta::CPAN
1234This source-code was inspired by the András Iványi reply on Stack Overflow
thread below:
( run in 0.241 second using v1.01-cache-2.11-cpan-1dc43b0fbd2 )