view release on metacpan or search on metacpan
Change: 9a54655bca8df754dd7f1ae72e1e35eda3e1506f
Author: Alceu Rodrigues de Freitas Junior <glaswalk3r@yahoo.com.br>
Date : 2019-03-01 02:19:12 +0000
More distributions blocked
Change: bf34f45eeab33540c54bb4779e90eb7787d527a1
Author: Alceu Rodrigues de Freitas Junior <arfjunior@uolinc.com>
Date : 2019-01-31 23:39:05 +0000
Change: 0a303addbd35a78bcbf2b113ead150ca8086991b
Author: Alceu Rodrigues de Freitas Junior <glasswalk3r@yahoo.com.br>
Date : 2018-07-27 19:51:51 +0000
Updated list of blocked distros
Change: 515c675810e3626b23b0717fc91fe4aae6081ed9
Author: Alceu Rodrigues de Freitas Junior <arfreitas@cpan.org>
Date : 2018-07-22 11:25:46 +0000
Change: 32caab31457e48772319a78f929afbbd0b54e29a
Author: Alceu Rodrigues de Freitas Junior <glasswalk3r@yahoo.com.br>
Date : 2018-07-02 18:28:07 +0000
Added more distros to be blocked
Change: 10f8da9c3a3cdb1e6154f3d5102678f8f96c4a90
Author: Alceu Rodrigues de Freitas Junior <glasswalk3r@yahoo.com.br>
Date : 2018-06-28 00:47:39 +0000
Change: 6f3cff62011558b493a5244b3e15ffcf36856b8c
Author: Alceu Rodrigues de Freitas Junior <arfreitas@cpan.org>
Date : 2018-02-16 14:24:30 +0000
Added more distros to be blocked
Change: ca8735d97bf54cc1798ec81d260ca1606c25108b
Author: Alceu Rodrigues de Freitas Junior <arfreitas@cpan.org>
Date : 2018-02-15 19:34:45 +0000
Date : 2017-11-23 17:20:23 +0000
Added alias for minicpan
Added alias creation for minicpan to always be invoked with
CPAN::Mini::LatestDistVersion. Added more distributions to be blocked
from smoker.
Change: ca0d686e5f3b431d5182c766648c0ec30c4c7f75
Author: Alceu Rodrigues de Freitas Junior <arfreitas@cpan.org>
Date : 2017-11-20 18:47:31 +0000
Change: 5a2b8b126853dc62dcbc46bde483ffe2a4bb4028
Author: Alceu Rodrigues de Freitas Junior <arfreitas@cpan.org>
Date : 2017-11-16 15:24:33 +0000
More distributions blocked from smoking
Change: 8450f8946a311dbbaced40b31971ad374271cf42
Author: Alceu Rodrigues de Freitas Junior <arfreitas@cpan.org>
Date : 2017-11-14 19:34:06 +0000
Change: 90b957c3edf2af7bd821732d68005abd3becf60d
Author: Alceu Rodrigues de Freitas Junior <arfreitas@cpan.org>
Date : 2017-11-14 14:18:55 +0000
Added new distribution which are blocked to be tested on smoker
Change: 36373259f0a260a21e6737c3dfd4cba32027a605
Author: Alceu Rodrigues de Freitas Junior <arfreitas@cpan.org>
Date : 2017-11-14 08:25:25 +0000
Change: 6ef2bdd54c1a7bd7f32e19737af18e0c960057cf
Author: Alceu Rodrigues de Freitas Junior <arfreitas@cpan.org>
Date : 2017-04-04 19:55:15 +0000
Added two new distros to be blocked on CPAN Smoker
Change: 5718a04a4a1ed858b8359263bf740e3fe5bbf8d2
Author: Alceu Rodrigues de Freitas Junior <arfreitas@cpan.org>
Date : 2017-03-26 12:51:28 +0000
view all matches for this distribution
view release on metacpan or search on metacpan
examples/config.ini view on Meta::CPAN
cc_author=default:yes pass/na:no
edit_report=default:ask/no pass/na:no
email_from=DAGOLDEN <xdg@hyperbolic.net>
send_duplicates=no
send_report=default:ask/yes pass/na:yes
# specify an internal mail server if direct mail sending is blocked
smtp_server=mail.speakeasy.net
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPAN/SQLite/META.pm view on Meta::CPAN
my $force = $args{force};
my $db_name = $CPAN::SQLite::db_name;
my $db = File::Spec->catfile($CPAN::Config->{cpan_home}, $db_name);
my $journal_file = $db . '-journal';
if (-e $journal_file) {
$CPAN::FrontEnd->mywarn('Database locked - cannot update.');
return;
}
my @args = ($^X, '-MCPAN::SQLite::META=setup,update,check', '-e');
if (-e $db && -s _) {
my $mtime_db = (stat(_))[9];
view all matches for this distribution
view release on metacpan or search on metacpan
t/30cpan_path.t view on Meta::CPAN
use warnings;
use Test::More;
# This tests attempts to load the maintainers file from cpan,
# which is blocked by cpantesters... which makes all its nice
# regression tests fail.
plan skip_all => "Running in cpantesters"
if $ENV{NO_NETWORK_TESTING};
plan tests => 4;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Labyrinth/Plugin/CPAN/Tester.pm view on Meta::CPAN
=over 4
=item CheckLock
Checks whether the specified user account is currently locked.
=item Lock
Tester has just registered on the site, lock the user profile until email is
confirmed.
lib/Labyrinth/Plugin/CPAN/Tester.pm view on Meta::CPAN
=cut
sub CheckLock {
my $userid = $tvars{'loginid'};
my @row = $dbi->GetQuery('hash','GetUserByID',$userid);
return if(@row && !$row[0]->{locked});
Labyrinth::Session::Logout();
$tvars{redirect} = '';
SetCommand('tester-locked');
}
sub Lock {
return unless RealmCheck('public','tester','admin');
my $userid = $cgiparams{'userid'};
view all matches for this distribution
view release on metacpan or search on metacpan
vhost/html/js/tiny_mce/langs/en.js view on Meta::CPAN
browse:"Browse",
class_name:"Class",
not_set:"-- Not set --",
clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",
clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",
popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",
invalid_data:"Error: Invalid values entered, these are marked in red.",
more_colors:"More colors"
},
contextmenu:{
align:"Alignment",
view all matches for this distribution
view release on metacpan or search on metacpan
vhost/cgi-bin/templates/users/user-edit.html
vhost/cgi-bin/templates/users/user-failure.html
vhost/cgi-bin/templates/users/user-forgot.html
vhost/cgi-bin/templates/users/user-item.html
vhost/cgi-bin/templates/users/user-list.html
vhost/cgi-bin/templates/users/user-locked.html
vhost/cgi-bin/templates/users/user-login-author.html
vhost/cgi-bin/templates/users/user-login.html
vhost/cgi-bin/templates/users/user-login-tester.html
vhost/cgi-bin/templates/users/user-pass.html
vhost/cgi-bin/templates/users/user-registered.html
view all matches for this distribution
view release on metacpan or search on metacpan
vhost/html/js/tiny_mce/langs/en.js view on Meta::CPAN
browse:"Browse",
class_name:"Class",
not_set:"-- Not set --",
clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",
clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",
popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",
invalid_data:"Error: Invalid values entered, these are marked in red.",
more_colors:"More colors"
},
contextmenu:{
align:"Alignment",
view all matches for this distribution
view release on metacpan or search on metacpan
vhost/cgi-bin/config/phrasebook.ini view on Meta::CPAN
# Wiki Pages
GetWikiPageVersion=SELECT * FROM wikipage WHERE pagename=? AND version=?
GetWikiPage=SELECT * FROM wikipage WHERE pagename=? ORDER BY version DESC LIMIT 1
SaveWikiPage=INSERT INTO wikipage (pagename,version,userid,comment,content,createdate) VALUES (?,?,?,?,?,?)
GetWikiHistory=SELECT w.pagename,w.version,w.createdate,w.comment,w.locked,u.* FROM wikipage AS w \
INNER JOIN users AS u ON w.userid=u.userid \
WHERE w.pagename=? ORDER BY w.version DESC
CheckWikiPage=SELECT version FROM wikipage WHERE pagename=? LIMIT 1
GetWikiIndex=SELECT * FROM wikiindex WHERE pagename=?
vhost/cgi-bin/config/phrasebook.ini view on Meta::CPAN
INNER JOIN users AS u ON w.userid=u.userid \
ORDER BY w.createdate DESC $limit
DeleteWikiPage=DELETE FROM wikipage WHERE version>? AND pagename=?
DeleteWikiPages=DELETE FROM wikipage WHERE pagename=?
DeleteWikiIndex=DELETE FROM wikiindex WHERE pagename=?
SetWikiLock=UPDATE wikipage SET locked=? WHERE pagename=?
WikiSearch=SELECT * FROM wikiindex AS x \
INNER JOIN wikipage AS w ON w.pagename=x.pagename AND w.version=x.version \
INNER JOIN users AS u ON w.userid=u.userid \
WHERE w.content LIKE ? \
view all matches for this distribution
view release on metacpan or search on metacpan
inc/bundle/Module/CoreList.pm view on Meta::CPAN
'CPAN::DeferredCode' => '5.50',
'CPAN::Distribution' => '1.93',
'CPAN::Distroprefs' => '6',
'CPAN::Distrostatus' => '5.5',
'CPAN::Exception::RecursiveDependency'=> '5.5',
'CPAN::Exception::blocked_urllist'=> '1.0',
'CPAN::Exception::yaml_not_installed'=> '5.5',
'CPAN::FTP' => '5.5001',
'CPAN::FTP::netrc' => '1.00',
'CPAN::FirstTime' => '5.53',
'CPAN::HandleConfig' => '5.5',
inc/bundle/Module/CoreList.pm view on Meta::CPAN
'B' => '1.29',
'CPAN' => '1.9600',
'CPAN::Author' => '5.5001',
'CPAN::CacheMgr' => '5.5001',
'CPAN::Distribution' => '1.9602',
'CPAN::Exception::blocked_urllist'=> '1.001',
'CPAN::HTTP::Client' => '1.9600',
'CPAN::HTTP::Credentials'=> '1.9600',
'CPAN::Index' => '1.9600',
'CPAN::LWP::UserAgent' => '1.9600',
'CPAN::Mirrors' => '1.9600',
inc/bundle/Module/CoreList.pm view on Meta::CPAN
'CPAN::DeferredCode' => 'cpan',
'CPAN::Distribution' => 'cpan',
'CPAN::Distroprefs' => 'cpan',
'CPAN::Distrostatus' => 'cpan',
'CPAN::Exception::RecursiveDependency'=> 'cpan',
'CPAN::Exception::blocked_urllist'=> 'cpan',
'CPAN::Exception::yaml_not_installed'=> 'cpan',
'CPAN::Exception::yaml_process_error'=> 'cpan',
'CPAN::FTP' => 'cpan',
'CPAN::FTP::netrc' => 'cpan',
'CPAN::FirstTime' => 'cpan',
inc/bundle/Module/CoreList.pm view on Meta::CPAN
'CPAN::DeferredCode' => undef,
'CPAN::Distribution' => undef,
'CPAN::Distroprefs' => undef,
'CPAN::Distrostatus' => undef,
'CPAN::Exception::RecursiveDependency'=> undef,
'CPAN::Exception::blocked_urllist'=> undef,
'CPAN::Exception::yaml_not_installed'=> undef,
'CPAN::Exception::yaml_process_error'=> undef,
'CPAN::FTP' => undef,
'CPAN::FTP::netrc' => undef,
'CPAN::FirstTime' => undef,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPAN/Audit/DB.pm view on Meta::CPAN
use warnings;
our $VERSION = '20260621.001';
sub db {
{"dists" => {"ActivePerl" => {"advisories" => [{"affected_versions" => ["==5.16.1.1601"],"cves" => ["CVE-2012-5377"],"description" => "Untrusted search path vulnerability in the installation functionality in ActivePerl 5.16.1.1601, when installed in...
}
__PACKAGE__;
view all matches for this distribution
view release on metacpan or search on metacpan
include/boost/container/detail/mutex.hpp view on Meta::CPAN
#ifndef _M_AMD64
/* These are already defined on AMD64 builds */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
long __cdecl _InterlockedCompareExchange(long volatile *Dest, long Exchange, long Comp);
long __cdecl _InterlockedExchange(long volatile *Target, long Value);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _M_AMD64 */
#pragma intrinsic (_InterlockedCompareExchange)
#pragma intrinsic (_InterlockedExchange)
#define interlockedcompareexchange _InterlockedCompareExchange
#define interlockedexchange _InterlockedExchange
#elif defined(WIN32) && defined(__GNUC__)
#define interlockedcompareexchange(a, b, c) __sync_val_compare_and_swap(a, c, b)
#define interlockedexchange __sync_lock_test_and_set
#endif /* Win32 */
/* First, define CAS_LOCK and CLEAR_LOCK on ints */
/* Note CAS_LOCK defined to return 0 on success */
include/boost/container/detail/mutex.hpp view on Meta::CPAN
#define BOOST_CONTAINER_CAS_LOCK(sl) boost_container_x86_cas_lock(sl)
#define BOOST_CONTAINER_CLEAR_LOCK(sl) boost_container_x86_clear_lock(sl)
#else /* Win32 MSC */
#define BOOST_CONTAINER_CAS_LOCK(sl) interlockedexchange((long volatile*)sl, (long)1)
#define BOOST_CONTAINER_CLEAR_LOCK(sl) interlockedexchange((long volatile*)sl, (long)0)
#endif
/* How to yield for a spin lock */
#define SPINS_PER_YIELD 63
#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPU/Z80/Disassembler.pm view on Meta::CPAN
__PACKAGE__->mk_accessors(
'memory', # memory to disassemble
'_type', # identified type of each memory address, TYPE_xxx
'instr', # array of Instruction objects at each address
'labels', # all defined labels
'_call_instr', # hash of all call instructions where we are blocked
'_can_call', # hash of all subroutines we may call:
# 1 : can be called, no stack impact
# 0 : has stack impact, needs to be checked manually
# sub {} : call sub->($self, $next_addr) to handle
# stack impact and return next code addresses
lib/CPU/Z80/Disassembler.pm view on Meta::CPAN
# continue on next addresses
push @stack, $instr->next_code;
}
# check if we can unwind any blocked calls, after all paths without calls are
# exhausted
push @stack, $self->_check_call_instr;
}
}
lib/CPU/Z80/Disassembler.pm view on Meta::CPAN
sub _check_call_instr {
my($self) = @_;
my @stack;
# check simple call instructions where we blocked
for my $addr (keys %{$self->_call_instr}) {
my $instr = $self->_get_instr($addr);
my $call_addr = $instr->NN;
if ( # if any of the calls is conditional, then _can_call
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CTK/Configuration.pm view on Meta::CPAN
# Ok
my %newconfig = $cfg->getall if $cfg && $cfg->can('getall');
$self->{files} = [$cfg->files] if $cfg && $cfg->can('files');
# Set only unlocked keys
my %lkeys = ();
foreach my $k (@{(LOCKED_KEYS)}) { $lkeys{$k} = 1 }
foreach my $k (keys(%newconfig)) { $self->{conf}->{$k} = $newconfig{$k} if $k && !$lkeys{$k} }
# Set statuses
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CXC/DB/DDL/Util.pm view on Meta::CPAN
my \%types = $CACHE{$dbd}{types}{dbd};
return "&$name", $types{ $+{type} }
if exists $types{ $+{type} };
}
# $symbols is a locked hash, so can't just grab a value
my $symbols = types( $dbd );
if ( exists $symbols->{$name} && defined( my $sub = $symbols->{$name} ) ) {
return $class->_expand_field_sub( $cache, $stash->{field_class}, $name, $sub->() );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/AgainstFile/Storable.pm view on Meta::CPAN
_create_dir_if_required($dir);
#Select locking implementation
my $locking = $options->{Locking} || 'AtomicWrite';
if($locking eq 'Flock') {
$self->{write} = \&_write_locked;
$self->{read} = \&_read_locked;
} elsif ($locking eq 'AtomicWrite') {
$self->{write} = \&_write_atomic;
$self->{read} = \&_read;
} else {
croak("Unrecognised locking model '$locking'");
lib/Cache/AgainstFile/Storable.pm view on Meta::CPAN
#
# Subroutines
#
sub _read_locked {
my($cache_filename, $fh) = @_;
# we don't want the filehandle. Suppose it might need to be closed
# under Win32? Close it anyway
$fh->close if $fh;
check_safe($cache_filename,"r") if(HAVE_FILE_POLICY);
my $ref_data = lock_retrieve($cache_filename);
TRACE("Fetched from cache file: $cache_filename");
return $$ref_data;
}
sub _write_locked {
my ($cache_filename, $data, $mtime) = @_;
check_safe($cache_filename,"w") if(HAVE_FILE_POLICY);
lock_store(\$data, $cache_filename);
TRACE("wrote cache file: $cache_filename");
_backtouch($cache_filename, $mtime);
view all matches for this distribution
view release on metacpan or search on metacpan
t/03-lock.t view on Meta::CPAN
for (my $j = 1; $j <= $rows; $j++) {
# my $r = ($j ** $it) x 4;
# sleep 1 if $$ % 2 == 0;
my $lk = $c->{__db}->cds_lock;
# diag("$$: locked, setting row $j");
my $rv = $c->set($j, $$);
$lk->cds_unlock();
# diag("$$: unlocked");
#diag("$$: set $j");
push @ids, $j;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/SharedMemoryBackend.pm view on Meta::CPAN
sub delete_key
{
my ( $self, $p_namespace, $p_key ) = @_;
my $store_ref = $self->_get_locked_store_ref( );
delete $store_ref->{ $p_namespace }{ $p_key };
$self->_set_locked_store_ref( $store_ref );
}
sub delete_namespace
{
my ( $self, $p_namespace ) = @_;
my $store_ref = $self->_get_locked_store_ref( );
delete $store_ref->{ $p_namespace };
$self->_set_locked_store_ref( $store_ref );
}
sub store
{
my ( $self, $p_namespace, $p_key, $p_data ) = @_;
my $store_ref = $self->_get_locked_store_ref( );
$store_ref->{ $p_namespace }{ $p_key } = $p_data;
$self->_set_locked_store_ref( $store_ref );
}
# create a IPC::ShareLite share under the ipc_identifier
lib/Cache/SharedMemoryBackend.pm view on Meta::CPAN
$share->unlock( LOCK_UN );
}
sub _get_locked_store_ref
{
return _Restore_Shared_Hash_Ref_With_Lock( $IPC_IDENTIFIER );
}
sub _set_locked_store_ref
{
my ( $self, $p_store_ref ) = @_;
_Store_Shared_Hash_Ref_And_Unlock( $IPC_IDENTIFIER, $p_store_ref );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/Cascade.pm view on Meta::CPAN
In a multiprocess, and especially a multiserver application caching is a very
effective means of improving results.
The tradeoff of increasing the scale of the caching is in added complexity.
For example, caching in a FastMmap based storage is much slower than using a
memory based cache, because pages must be locked to ensure that no corruption
will happen. Likewise Memcached is even more overhead than FastMmap because it
is network bound, and uses blocking IO (on the client side).
This module attempts to make a transparent cascade of caches using several
backends.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/FastMmap.pm view on Meta::CPAN
not already exist. If the share_file specified does already
exist, it defaults to 0.
=item * B<catch_deadlocks>
Sets an alarm(10) before each page is locked via fcntl(F_SETLKW) to catch
any deadlock. This used to be the default behaviour, but it's not really
needed in the default case and could clobber sub-second Time::HiRes
alarms setup by other code. Defaults to 0.
=back
lib/Cache/FastMmap.pm view on Meta::CPAN
} || do {
$Err = $@ || 'unknown error';
};
# On error, always unlock (caller can't clean up after a thrown exception).
# On success, unlock unless caller asked us to leave the page locked.
if (defined $Err) {
fc_unlock($Cache) if $Locked && fc_is_locked($Cache);
die $Err;
}
if (!$SkipUnlock) {
fc_unlock($Cache);
$Locked = 0;
lib/Cache/FastMmap.pm view on Meta::CPAN
1;
} || do {
$Err = $@ || 'unknown error';
};
if (defined $Err) {
fc_unlock($Cache) if $Locked && fc_is_locked($Cache);
die $Err;
}
# If explicitly asked to skip unlocking, return a sentinel so callers
# using the old 3-tuple unpack still work (slot 2 is now a placeholder).
lib/Cache/FastMmap.pm view on Meta::CPAN
# Are we doing writeback's? If so, need to mark as dirty in cache
my $write_back = $Self->{write_back};
# Hash value, lock page (unless caller already holds the lock)
my ($HashPage, $HashSlot) = fc_hash($Cache, $_[1]);
fc_lock($Cache, $HashPage) unless $Opts && $Opts->{_locked};
my ($DidStore, $Err);
eval {
my $Val = $Self->{serialize} ? $Self->{serialize}(\$_[2]) : $_[2];
$Val = $Self->{compress}($Val) if $Self->{compress};
lib/Cache/FastMmap.pm view on Meta::CPAN
1;
} || do {
$Err = $@ || 'unknown error';
};
# Always unlock â caller passed _locked to transfer ownership
fc_unlock($Cache) if fc_is_locked($Cache);
die $Err if defined $Err;
# If we're doing write-through, or write-back and didn't get into cache,
# write back to the underlying store
if ((!$write_back || !$DidStore) && (my $write_cb = $Self->{write_cb})) {
lib/Cache/FastMmap.pm view on Meta::CPAN
=item I<get_and_set($Key, $AtomicSub)>
Atomically retrieve and set the value of a Key.
The page is locked while retrieving the $Key and is unlocked only after
the value is set, thus guaranteeing the value does not change between
the get and set operations.
$AtomicSub is a reference to a subroutine that is called to calculate the
new value to store. $AtomicSub gets $Key, the current value from the
lib/Cache/FastMmap.pm view on Meta::CPAN
operations lock the page and you may end up with a dead lock!
=item *
If your sub does a die/throws an exception, the page will correctly
be unlocked (1.15 onwards)
=back
=cut
sub get_and_set {
my ($Self, $Cache) = ($_[0], $_[0]->{Cache});
my ($Value, $DidStore, $Err);
eval {
($Value, undef, my $Opts) = $Self->get($_[1], { skip_unlock => 1 });
# Page is still locked here.
my @NewValue = $_[2]->($_[1], $Value, $Opts);
$DidStore = 0;
if (@NewValue) {
($Value, my $SetOpts) = @NewValue;
die "get_and_set callback options must be a hash reference"
if defined($SetOpts) && ref($SetOpts) ne 'HASH';
# set() with _locked=>1 takes ownership of the lock and unlocks at end.
$DidStore = $Self->set($_[1], $Value, { _locked => 1, %{$SetOpts || {}} });
} else {
fc_unlock($Cache);
}
1;
} || do {
$Err = $@ || 'unknown error';
};
if (defined $Err) {
fc_unlock($Cache) if fc_is_locked($Cache);
die $Err;
}
return wantarray ? ($Value, $DidStore) : $Value;
}
lib/Cache/FastMmap.pm view on Meta::CPAN
($Val, $Flags, $Found, $ExpireOn) = fc_read($Cache, $HashSlot, $_[1]);
1;
} || do {
$Err = $@ || 'unknown error';
};
fc_unlock($Cache) if fc_is_locked($Cache);
die $Err if defined $Err;
return $Found;
}
lib/Cache/FastMmap.pm view on Meta::CPAN
sub remove {
my ($Self, $Cache) = ($_[0], $_[0]->{Cache});
# Hash value, lock page (unless caller already holds the lock), delete
my ($HashPage, $HashSlot) = fc_hash($Cache, $_[1]);
fc_lock($Cache, $HashPage) unless $_[2] && $_[2]->{_locked};
my ($DidDel, $Flags, $Err);
eval {
($DidDel, $Flags) = fc_delete($Cache, $HashSlot, $_[1]);
1;
} || do {
$Err = $@ || 'unknown error';
};
fc_unlock($Cache) if fc_is_locked($Cache);
die $Err if defined $Err;
# If we deleted from the cache, and it's not dirty, also delete
# from underlying store
if ((!$DidDel || ($DidDel && !($Flags & FC_ISDIRTY)))
lib/Cache/FastMmap.pm view on Meta::CPAN
=item I<get_and_remove($Key)>
Atomically retrieve value of a Key while removing it from the cache.
The page is locked while retrieving the $Key and is unlocked only after
the value is removed, thus guaranteeing the value stored by someone else
isn't removed by us.
=cut
sub get_and_remove {
my ($Self, $Cache) = ($_[0], $_[0]->{Cache});
my ($Value) = $Self->get($_[1], { skip_unlock => 1 });
my $DidDel = $Self->remove($_[1], { _locked => 1 });
return wantarray ? ($Value, $DidDel) : $Value;
}
=item I<expire($Key)>
lib/Cache/FastMmap.pm view on Meta::CPAN
}
1;
} || do {
$Err = $@ || 'unknown error';
};
fc_unlock($Cache) if fc_is_locked($Cache);
die $Err if defined $Err;
# If it's dirty, write it back
if (($Flags & FC_ISDIRTY) && (my $write_cb = $Self->{write_cb})) {
if (defined $Val) {
lib/Cache/FastMmap.pm view on Meta::CPAN
fc_reset_page_details($Cache) if $Clear;
1;
} || do {
$Err = $@ || 'unknown error';
};
fc_unlock($Cache) if fc_is_locked($Cache);
die $Err if defined $Err;
}
return ($NReads, $NReadHits);
}
=item I<multi_get($PageKey, [ $Key1, $Key2, ... ])>
The two multi_xxx routines act a bit differently to the
other routines. With the multi_get, you pass a separate
PageKey value and then multiple keys. The PageKey value
is hashed, and that page locked. Then that page is
searched for each key. It returns a hash ref of
Key => Value items found in that page in the cache.
The main advantage of this is just a speed one, if you
happen to need to search for a lot of items on each call.
lib/Cache/FastMmap.pm view on Meta::CPAN
1;
} || do {
$Err = $@ || 'unknown error';
};
fc_unlock($Cache) if fc_is_locked($Cache);
die $Err if defined $Err;
return \%KVs;
}
lib/Cache/FastMmap.pm view on Meta::CPAN
1;
} || do {
$Err = $@ || 'unknown error';
};
fc_unlock($Cache) if fc_is_locked($Cache);
die $Err if defined $Err;
return 1;
}
lib/Cache/FastMmap.pm view on Meta::CPAN
$Self->_expunge_page($Mode, $WB, -1);
1;
} || do {
$Err = $@ || 'unknown error';
};
fc_unlock($Cache) if fc_is_locked($Cache);
die $Err if defined $Err;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/Isolator.pm view on Meta::CPAN
last TRYLOOP if $value;
$try++;
my @lockkeys = map { $key .":lock:". $_ } shuffle 1..$self->concurrency;
foreach my $lockkey ( @lockkeys ) {
my $locked = $self->cache->add($lockkey, 1, $self->timeout ); #lock
if ( $locked ) {
try {
$value = $self->get($key);
return 1 if $value;
$value = $cb->();
$self->set( $key, $value, $expires );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/Memcached/PDeque.pm view on Meta::CPAN
last if $have_lock;
sleep(.1);
}
affirm {
my $locked_by = $self->memcached->get("$priority:lock");
$$ == $locked_by;
};
}
sub _unlock {
my ( $self, $priority ) = @_;
affirm {
my $locked_by = $self->memcached->get("$priority:lock");
$$ == $locked_by;
};
$self->memcached->delete("$priority:lock");
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/Memcached/Queue.pm view on Meta::CPAN
my $serialized = $self->serializer->serialize($value);
$value = $serialized;
undef $serialized;
}
$self->load;
if(!$self->_is_locked || $self->_unlock){
$self->_lock;
my $size = $self->size // 0;
#checando se a fila esta cheia
if($self->max_enq > 0 && $self->size >= $self->max_enq){
say "Queue is full!";
lib/Cache/Memcached/Queue.pm view on Meta::CPAN
$self->memcached->set($new_last,$value,0);
}
$self->size($size);
$self->_save(['last','size']);
$self->_unlock if($self->_is_locked);
}
}
return $ok;
}
lib/Cache/Memcached/Queue.pm view on Meta::CPAN
sub deq {
my ( $self, ) = @_;
my ( $last_item,$value ) = ( undef,undef );
$self->load;
if(!$self->_is_locked || $self->_unlock ){
$self->_lock;
my $size = $self->size;
if(!$size){
say 'Queue is empty!';
}
lib/Cache/Memcached/Queue.pm view on Meta::CPAN
$self->_save(['last']);
}
}
$self->size($size);
$self->_save(['first','size']);
$self->_unlock if($self->_is_locked);
}
return $value // '';
}
lib/Cache/Memcached/Queue.pm view on Meta::CPAN
my ($self,$pid,$lock_pid) = (shift,$$,0);
$self->load;
my $qid = $self->qid;
confess "Panic! No 'qid'!" if (!defined($qid) || !$qid);
my $lock_idx = $qid . 'LOCKED';
$lock_pid = $self->_is_locked($lock_idx);
if(!$lock_pid){
my $rs = $self->memcached->set($lock_idx,$pid,0);
confess "Memcached server can't write!" if !defined($rs);
$lock_pid = $pid;
}
else {
say "is already locked!";
$lock_pid = 0;
}
$self->load;
return $lock_pid || 0;
}
lib/Cache/Memcached/Queue.pm view on Meta::CPAN
my ($self,$pid,$ok) = (shift,$$,0);
$self->load;
my $qid = $self->qid;
confess "Panic! No 'qid'!" if (!defined($qid) || !$qid);
my $lock_idx = $qid . 'LOCKED';
my $lock_pid = $self->_is_locked($lock_idx);
if($lock_pid && $lock_pid == $pid){
my $rs = $self->memcached->set($lock_idx,0,0);
confess "Memcached can't write!" if !defined($rs);
$ok = 1;
}
elsif($lock_pid && $lock_pid != $pid){
say "Is locked by another process! $lock_pid";
}
$self->load;
return $ok;
}
lib/Cache/Memcached/Queue.pm view on Meta::CPAN
sub _is_locked {
my ($self,$lock_idx) = @_;
$lock_idx = 0 if !defined $lock_idx;
my $found = 0;
# confess "Parameter 'lock_idx' is mandatory!" if (!defined($lock_idx) || !$lock_idx);
if(!defined($lock_idx) || !$lock_idx){
$lock_idx = $self->qid . 'LOCKED';
}
my $lock_pid = $self->memcached->get($lock_idx); #this pid locked the queue!
# $lock_pid = 0 if $$ == $lock_pid;
# foreach my $p(@{$t->table}){
# if($p->pid == $lock_pid){
# $found = $p->pid;
# last;
view all matches for this distribution
view release on metacpan or search on metacpan
t/001.lock.t view on Meta::CPAN
my $c_lock = Cache::Memcached::Semaphore->new( memd => $memd, name => "c_test" );
my $s_lock = Cache::Memcached::Semaphore::acquire( memd => $memd, name => "s_test" );
ok( $c_lock, "Inner block constructor acquired" );
ok( $s_lock, "Inner block sub acquired" );
ok( !Cache::Memcached::Semaphore->new( memd => $memd, name => "c_test" ), "Inner block constructor locked" );
ok( !Cache::Memcached::Semaphore::acquire( memd => $memd, name => "s_test" ), "Inner block sub locked" );
}
my $c_lock = Cache::Memcached::Semaphore->new( memd => $memd, name => "c_test" );
my $s_lock = Cache::Memcached::Semaphore::acquire( memd => $memd, name => "s_test" );
ok( $c_lock, "Outer block constructor acquired" );
ok( $s_lock, "Outer block sub acquired" );
ok( !Cache::Memcached::Semaphore->new( memd => $memd, name => "c_test" ), "Outer block constructor locked" );
ok( !Cache::Memcached::Semaphore::acquire( memd => $memd, name => "s_test" ), "Outer block sub locked" );
# timeout
ok( Cache::Memcached::Semaphore->new( memd => $memd, name => "c_timeout", timeout => 10 ), "Constructor with timeout" );
ok( !Cache::Memcached::Semaphore->new( memd => $memd, name => "c_timeout", timeout => 10 ), "Constructor with timeout locked" );
ok( Cache::Memcached::Semaphore::acquire( memd => $memd, name => "s_timeout", timeout => 10 ), "Sub with timeout" );
ok( !Cache::Memcached::Semaphore::acquire( memd => $memd, name => "s_timeout", timeout => 10 ), "Sub with timeout locked" );
ok( Cache::Memcached::Semaphore::wait_acquire( memd => $memd, name => "w_timeout", timeout => 2 ), "Wait lock. Create with timeout" );
ok( Cache::Memcached::Semaphore::wait_acquire( memd => $memd, name => "w_timeout", timeout => 10), "Wait indefinitely. Create with timeout" );
ok( !Cache::Memcached::Semaphore::wait_acquire( memd => $memd, name => "w_timeout", timeout => 10, max_wait => 1), "Wait 1 sec. No acquire" );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/Memcached/Turnstile.pm view on Meta::CPAN
computed values for each input key in turn.
The C<wait> parameter works fundamentally the same as in the single-key function,
but the callback variant also receives a third parameter:
The list of keys whose values weren't available from the cache and couldn't be
locked for computation. The callback is expected to return a hash reference
of keys and values. This is different from the C<compute_cb> interface
to allow for easy calling back into C<multi_cache_get_or_compute> for retries
(see the C<wait> example for the single-key implementation above).
As with the single-key variant, C<compute_time> is the additional
view all matches for this distribution
view release on metacpan or search on metacpan
or croak "Can't seek to beginning: $!";
syswrite($self->{_fh},$head,$headsize)==$headsize
or croak "Can't write file header: $!";
}
# mmap() isn't supposed to work on locked files, so unlock
$self->_unlock;
mmap($self->{_mmap}='',$size,$self->{_fh})
or do{
delete $self->{_mmap};
close $self->{_fh};
}
=item _lock($offset)
Lock the cache file. If $offset is zero, the file header is locked.
Otherwise, the bucket starting at $offset is locked.
XXX This also needs to create an internal lock if threading is enabled.
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
get_if_same:
if(!defined(is_same(...))) {
if(my $FH = open_with_flock(LOCK_EX, block => 0)) {
$cache::static::_curr_locked_FH = $FH;
} else {
#wait until it's been set, then return it
open_with_flock(LOCK_SH, block => 1);
return get(...);
}
} else {
return get(...);
}
set:
my $FH = $cache::static::_curr_locked_FH || open(...);
...
close($FH);
an optimization idea stolen from the lighthttpd folks:
in the case where you allow old results:
before writing, copy the cache file "$f" to "$f.bak"
any get_if_same() during that time reads "$f.bak"
when done, remove "$f.bak" (this results in race condition in reader:
1 - find the file locked, try the .bak file
2 - .bak file is removed, goto 1
OR have a crontab that runs e.g. hourly to clean up .bak files...
start the lock when generation starts, remove the lock when new value
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/File.pm view on Meta::CPAN
sub purge {
my Cache::File $self = shift;
my $time = time();
# if it's locked, someone else will probably be doing a purge already
$self->trylock() or return;
# open expiry index
my $expheap = $self->get_exp_heap();
lib/Cache/File.pm view on Meta::CPAN
return $self->lock(1);
}
sub unlock {
my Cache::File $self = shift;
$self->{lock} or croak "not locked";
return unless --$self->{lockcount} == 0;
# close heaps and save counts
$self->{openexp} = undef;
$self->{openage} = undef;
lib/Cache/File.pm view on Meta::CPAN
}
sub get_index {
my Cache::File $self = shift;
unless ($self->{openidx}) {
$self->{lock} or croak "not locked";
my $indexfile = $self->{index};
File::NFSLock::uncache($indexfile) if $self->{locklevel} == LOCK_NFS;
my $oldmask = umask $self->cache_umask();
lib/Cache/File.pm view on Meta::CPAN
}
sub _open_heap {
my Cache::File $self = shift;
my ($heapfile) = @_;
$self->{lock} or croak "not locked";
File::NFSLock::uncache($heapfile) if $self->{locklevel} == LOCK_NFS;
my $oldmask = umask $self->cache_umask();
my $heap = Cache::File::Heap->new($heapfile);
view all matches for this distribution
view release on metacpan or search on metacpan
t/02locks.t view on Meta::CPAN
my $cal2;
ok($cal2 = get_cal_dav('birthday.ics'), "Instantiated ok");
ok(!$cal2->lock, "Failed to get lock with second cal");
# Unlock
ok($cal->unlock, "Unlocked first cal");
# Obtain lock
ok($cal2->lock, "Got lock with second cal");
# Forceably unlock
ok($cal->forcefully_unlock_all, "First cal forcefully unlocked");
# Lock
ok($cal->lock, "First cal got lock back");
# Steal lock
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Calendar/Plugin/Renderer.pm view on Meta::CPAN
my $text = Calendar::Plugin::Renderer::Text->new($params);
my $line1 = $text->get_dashed_line;
my $line2 = $text->get_month_header;
my $line3 = $text->get_blocked_line;
my $line4 = $text->get_day_header;
my $empty = $text->get_empty_space;
my $dates = $text->get_dates;
my $calendar = join("\n", $line1, $line2, $line3, $line4, $line3, $empty.$dates)."\n";
view all matches for this distribution