Hi Sharon,

Thank you for your reply.

When I sent the STAF command to request a mutex, I got no response back at all. 
It seems it was waiting for something. I couldn’t type any commands at all in 
the DOS command window. I had to use “Ctrl-C” to terminate.  It looked like 
this:
C:\>STAF local SEM REQUEST MUTEX MutexStart GARBAGECOLLECT NO

I figured out the mutex I requested was a pending mutex. I think the request 
was in a queue. That is why it is waiting.

It would be nice to get back the control even the requested mutex is pending.

Thanks,

Cindy

From: Sharon Lucas [mailto:luc...@us.ibm.com]
Sent: February-28-12 3:57 PM
To: Cindy Zhu
Cc: staf-users@lists.sourceforge.net
Subject: Re: [staf-users] Request Mutex

Hi Cindy,

If the SEM REQUEST MUTEX request worked, you get RC 0 and no message in the 
result.  You can then query the mutex if you like to see that it is now exists 
and is owned.  For example:

C:\>STAF local SEM REQUEST MUTEX MutexStart GARBAGECOLLECT NO
Response
--------


C:\>STAF local SEM QUERY MUTEX MutexStart
Response
--------
{
  State           : Owned
  Owner           : {
    Machine                   : client1.austin.ibm.com
    Handle Name               : STAF/Client
    Handle                    : 147
    User                      : none://anonymous
    Endpoint                  : local://local
    Date-Time Requested       : 20120228-16:46:08
    Date-Time Acquired        : 20120228-16:46:08
    Perform Garbage Collection: No
  }
  Pending Requests: []
}

When you're ready to release the mutex semaphore, you can do so as follows.  
Note that if successful, RC=0 and there will be no message in the result.

C:\>STAF local SEM RELEASE MUTEX MutexStart FORCE
Response
--------


C:\>STAF local SEM QUERY MUTEX MutexStart
Response
--------
{
  State           : Unowned
  Owner           : <None>
  Pending Requests: []
}

C:\>

Note that the section "8.15.2 REQUEST" in the STAF User's Guide at 
http://staf.sourceforge.net/current/STAFUG.htm#HDRSEMSRV says in its "Results" 
sub-section says:

Results

The result buffer will contain no data on a successful return from a REQUEST 
command.


Note that many STAF service requests do not return any data in the result when 
successful when there is nothing more to say.  The RC=0 indicates that the STAF 
service request was successful.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com<mailto:luc...@us.ibm.com>
(512) 286-7313 or Tieline 363-7313




From:        Cindy Zhu <c...@fekete.com<mailto:c...@fekete.com>>
To:        
"staf-users@lists.sourceforge.net<mailto:staf-users@lists.sourceforge.net>" 
<staf-users@lists.sourceforge.net<mailto:staf-users@lists.sourceforge.net>>,
Date:        02/28/2012 03:40 PM
Subject:        [staf-users] Request Mutex

________________________________



Hi,

I sent a STAF command “STAF local SEM REQUEST MUTEX MutexStart GARBAGECOLLECT 
NO” to request a mutex from the command line.  But I didn’t see any response.

Can you please tell me how to debug this?

I tried other STAF commands on the same machine and I got responses.

Thanks,

Cindy
 ------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net<mailto:staf-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to