[ace-users] ACE_Semaphore::acquire (tv) error

Johnny Willemsen jwillemsen at remedy.nl
Sat Jul 28 08:36:53 CDT 2007


Hi,

Probably you have used the autoconf way of compiling, please use the
traditional way.

Regards,

Johnny Willemsen
Remedy IT
Postbus 101
2650 AC  Berkel en Rodenrijs
The Netherlands
www.theaceorb.nl / www.remedy.nl =20

*** Integrated compile and test statistics see
http://scoreboard.theaceorb.nl ***
*** Commercial service and support for ACE/TAO/CIAO             ***
*** See http://www.theaceorb.nl/en/support.html                 ***=20

> HI :
> PRF:
> ACE VERSION: 5.5.9
>=20
>   HOST MACHINE and OPERATING SYSTEM:
>        Red Hat Enterprise Linux AS release 4 (Nahant Update 3)  run
> on wmware workstation 6.0
>=20
>   COMPILER NAME AND VERSION (AND PATCHLEVEL):
>   gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)
>=20
>   Question:
> I wirte simple test:
>   #include <ace/Semaphore.h>
>   #include <ace/Time_Value.h>
>   #include <ace/OS.h>
>   #include <iostream>
>=20
>  int main (int argc, char *argv[])
>  {
>    ACE_Semaphore sem (0);
>    ACE_Time_Value tv =3D ACE_OS::gettimeofday ();
>    tv.sec (tv.sec () + 5);
>    if (sem.acquire (tv) =3D=3D -1)                 // but it does't =
block
> , if use sem.acquire () it's block
>       perror ("");                             // it print "Operation
> not supported"
>    std::cout << "over" << std::endl;
>    return 0;
>  }
>  why use timeout acquire doesn't block? and why "Operation=20
> not supported"
>=20
> --=20
> |  (\_/)  This is Bunny. Copy and paste Bunny
> | (=3D'.'=3D) into your signature to help him gain
> | (")_(") world domination.
>=20
> =B4=DE=C9=D9=CE=B0
> Tel:    13810421852
> QQ:    43458943
> MSN: shaovie at hotmail.com
>=20



More information about the Ace-users mailing list