Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: threads::shared - acquire lock on an object that has a socket

by BrowserUk (Pope)
on Apr 25, 2014 at 12:53 UTC ( #1083785=note: print w/ replies, xml ) Need Help??


in reply to threads::shared - acquire lock on an object that has a socket

See notes; answer embedded questions:

sub new { my $class = shift; my $arg = shift; ## What is $arg? Why is it never used? # share (my %this); ## this is an obfuscated way to share a variabl +e my %this :shared; ## the correct way $this{_socket} = shift; ## Presumably this is the socket? Is this +where you get the error? $this{_sendBufferCount} = 0; ## bless \%this, $class; ## bless returns the blessed reference; yo +u are throwing it away ## return \%this; ## this returns an unblessed reference to the has +h -- no good for OO. ## Do it this way. return bless \%this, $class; }

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: threads::shared - acquire lock on an object that has a socket
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1083785]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2015-07-07 08:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls