<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE></TITLE>
<META content="MSHTML 6.00.6000.16981" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV><FONT face=Arial color=#0000ff size=2>Hello,<BR>I have the
backtraces.<BR>This is the output of 'openserctl ps'</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>Process:: ID=0 PID=934
Type=attendant<BR>Process:: ID=1 PID=949 Type=SIP receiver
udp:10.45.8.234:5060<BR>Process:: ID=2 PID=950 Type=SIP receiver
udp:10.45.8.234:5060<BR>Process:: ID=3 PID=951 Type=SIP receiver
udp:10.45.8.234:5060<BR>Process:: ID=4 PID=952 Type=SIP receiver
udp:10.45.8.234:5060<BR>Process:: ID=5 PID=957
Type=timer<BR>Process:: ID=6 PID=958 Type=MI FIFO<BR>Process:: ID=7
PID=959 Type=TCP receiver<BR>Process:: ID=8 PID=962 Type=TCP
receiver<BR>Process:: ID=9 PID=963 Type=TCP receiver<BR>Process::
ID=10 PID=964 Type=TCP receiver<BR>Process:: ID=11 PID=965 Type=TCP
main</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>The process <SPAN
class=260052609-30032010>952 </SPAN>is on loop, you can see below the output of
ps command.</FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=260052609-30032010>T</SPAN>his time <SPAN
class=260052609-30032010>gdb</SPAN> gives more info<SPAN
class=260052609-30032010> on process in loop.</SPAN></FONT></FONT></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>This is the backtrace of each
process:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>934 [attendant]<BR>(gdb)
bt<BR>#0 0x4004ccd0 in pause () from
/usr/local/lib2/libpthread.so.0</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>949 [udp receiver]<BR>(gdb)
bt<BR>#0 0x4004c0f0 in read () from
/usr/local/lib2/libpthread.so.0</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>950 [udp receiver]<BR>(gdb)
bt<BR>#0 0x4004c0f0 in read () from
/usr/local/lib2/libpthread.so.0</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>951 [udp receiver]<BR>(gdb)
bt<BR>#0 0x4004c0f0 in read () from
/usr/local/lib2/libpthread.so.0</FONT></DIV>
<DIV> </DIV>
<DIV><BR><FONT face=Arial color=#0000ff size=2>952 [udp receiver in loop]
<BR>(gdb) bt<BR>#0 0x403a2dc4 in t_retransmit_reply () from
/usr/local/ser/tm.so<BR>#1 0x40397734 in t_newtran () from
/usr/local/ser/tm.so<BR>#2 0x4038c178 in t_relay_to () from
/usr/local/ser/tm.so<BR>#3 0x4039bba0 in load_tm () from
/usr/local/ser/tm.so</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>957 [Timer]<BR>(gdb) bt<BR>#0
0x401459d8 in select () from /usr/local/lib2/libc.so.6</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><BR><FONT face=Arial color=#0000ff size=2>958 [MI FIFO]<BR>(gdb)
bt<BR>#0 0x4013f5f0 in read () from /usr/local/lib2/libc.so.6<BR>#1
0x00400f8c in mem_pool ()<BR>#2 0x00400f8c in mem_pool ()</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=260052609-30032010><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>959 [TCP receiver]<BR>(gdb)
bt<BR>#0 0x400c672c in __libc_allocate_rtsig_private () from
/usr/local/lib2/libc.so.6<BR>#1 0x400c67a0 in sigtimedwait () from
/usr/local/lib2/libc.so.6<BR>#2 0x0006ba2c in force_tcp_conn_lifetime
()<BR>#3 0x400080d0 in _dl_rtld_di_serinfo () from
/usr/local/lib2/ld-linux.so.2<BR>#4 0x000f1658 in tcp_children
()</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>962 [TCP receiver]<BR>(gdb)
bt<BR>#0 0x400c672c in __libc_allocate_rtsig_private () from
/usr/local/lib2/libc.so.6<BR>#1 0x400c67a0 in sigtimedwait () from
/usr/local/lib2/libc.so.6<BR>#2 0x0006ba2c in force_tcp_conn_lifetime
()<BR>#3 0x400080d0 in _dl_rtld_di_serinfo () from
/usr/local/lib2/ld-linux.so.2<BR>#4 0x000f1658 in tcp_children
()</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><BR><FONT face=Arial color=#0000ff size=2>963 [TCP receiver]<BR>(gdb)
bt<BR>#0 0x400c672c in __libc_allocate_rtsig_private () from
/usr/local/lib2/libc.so.6<BR>#1 0x400c67a0 in sigtimedwait () from
/usr/local/lib2/libc.so.6<BR>#2 0x0006ba2c in force_tcp_conn_lifetime
()<BR>#3 0x400080d0 in _dl_rtld_di_serinfo () from
/usr/local/lib2/ld-linux.so.2<BR>#4 0x000f1658 in tcp_children
()</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><BR><FONT face=Arial color=#0000ff size=2>964 [TCP receiver]<BR>(gdb)
bt<BR>#0 0x400c672c in __libc_allocate_rtsig_private () from
/usr/local/lib2/libc.so.6<BR>#1 0x400c67a0 in sigtimedwait () from
/usr/local/lib2/libc.so.6<BR>#2 0x0006ba2c in force_tcp_conn_lifetime
()<BR>#3 0x400080d0 in _dl_rtld_di_serinfo () from
/usr/local/lib2/ld-linux.so.2<BR>#4 0x000f1658 in tcp_children
()</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>965 [TCP main]<BR>(gdb)
bt<BR>#0 0x400c672c in __libc_allocate_rtsig_private () from
/usr/local/lib2/libc.so.6<BR>#1 0x400c67a0 in sigtimedwait () from
/usr/local/lib2/libc.so.6<BR>#2 0x00063bcc in tcpconn_put ()</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=260052609-30032010><FONT face=Arial color=#0000ff size=2>>
ps axu</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff
size=2>root 934 0.0 2.7 31464
7068 ? S
15:10 0:01 openser -m 16 -P /var/run/ser.pid -f
/etc/sam/ser/ser_IR.cfg -l udp:10.45.8.234 5060
tcp:10.45.8.234:5060</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff
size=2>root 949 7.8 3.0 31588
7724 ? S
15:10 3:05 openser -m 16 -P /var/run/ser.pid -f
/etc/sam/ser/ser_IR.cfg -l udp:10.45.8.234 5060
tcp:10.45.8.234:5060<BR>root 950
0.0 3.0 31584 7740 ?
S 15:10 0:00 openser -m 16 -P /var/run/ser.pid -f
/etc/sam/ser/ser_IR.cfg -l udp:10.45.8.234 5060
tcp:10.45.8.234:5060<BR>root 951
0.0 3.1 31588 8112 ?
S 15:10 0:01 openser -m 16 -P /var/run/ser.pid -f
/etc/sam/ser/ser_IR.cfg -l udp:10.45.8.234 5060
tcp:10.45.8.234:5060</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff
size=2>root 952 20.6 3.0 31584 7780
? R
15:10 8:09 openser -m 16 -P /var/run/ser.pid -f
/etc/sam/ser/ser_IR.cfg -l udp:10.45.8.234 5060
tcp:10.45.8.234:5060</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff
size=2>root 957 0.0 2.9 31464
7664 ? S
15:10 0:00 openser -m 16 -P /var/run/ser.pid -f
/etc/sam/ser/ser_IR.cfg -l udp:10.45.8.234 5060
tcp:10.45.8.234:5060</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff
size=2>root 958 0.0 2.7 31468
7084 ? S
15:10 0:00 openser -m 16 -P /var/run/ser.pid -f
/etc/sam/ser/ser_IR.cfg -l udp:10.45.8.234 5060
tcp:10.45.8.234:5060</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff
size=2>root 959 0.0 2.7 31464
7140 ? S
15:10 0:00 openser -m 16 -P /var/run/ser.pid -f
/etc/sam/ser/ser_IR.cfg -l udp:10.45.8.234 5060
tcp:10.45.8.234:5060<BR>root 962
0.0 2.7 31464 7140 ?
S 15:10 0:00 openser -m 16 -P /var/run/ser.pid -f
/etc/sam/ser/ser_IR.cfg -l udp:10.45.8.234 5060
tcp:10.45.8.234:5060<BR>root 963
0.0 2.7 31464 7140 ?
S 15:10 0:00 openser -m 16 -P /var/run/ser.pid -f
/etc/sam/ser/ser_IR.cfg -l udp:10.45.8.234 5060
tcp:10.45.8.234:5060<BR>root 964
0.0 2.7 31464 7140 ?
S 15:10 0:00 openser -m 16 -P /var/run/ser.pid -f
/etc/sam/ser/ser_IR.cfg -l udp:10.45.8.234 5060
tcp:10.45.8.234:5060</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff
size=2>root 965 0.0 2.7 31464
7124 ? S
15:10 0:00 openser -m 16 -P /var/run/ser.pid -f
/etc/sam/ser/ser_IR.cfg -l udp:10.45.8.234 5060
tcp:10.45.8.234:5060</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=260052609-30032010><FONT face=Arial color=#0000ff
size=2>daniele</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Messaggio originale-----<BR><B>Da:</B> Daniel-Constantin Mierla
[mailto:miconda@gmail.com]<BR><B>Inviato:</B> lunedì 29 marzo 2010
11.01<BR><B>A:</B> Zappasodi Daniele<BR><B>Cc:</B> sr-dev;
users@lists.kamailio.org<BR><B>Oggetto:</B> Re: [Kamailio-Users] R: R: Fast
lock loop with arm<BR><BR></FONT></DIV>Hello,<BR><BR>On 3/29/10 8:53 AM,
Zappasodi Daniele wrote:
<BLOCKQUOTE
cite=mid:14A9059A37EF9A45BC2520DE64C30F60075258@slttex002.seltatel.local
type="cite">
<META content="MSHTML 6.00.6000.16981" name=GENERATOR>
<DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-GB>Hello,<O:P></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB>I have tried
a lot of times with different processes, but backtrace shows always only
this.</SPAN></P></DIV></BLOCKQUOTE><BR>this is really strange. do you use
mi_fifo? if yes, when you start openser run 'openserctl ps'<BR><BR>Spot a udp
worker process, the mi fifo process, the main process and the timer process.
when the locking happens, attach to each of them and get the backtrace.
<BR><BR>Thanks,<BR>Daniel<BR><BR>
<BLOCKQUOTE
cite=mid:14A9059A37EF9A45BC2520DE64C30F60075258@slttex002.seltatel.local
type="cite">
<DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-GB><O:P></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-GB><O:P></O:P></SPAN></P><SPAN lang=EN-GB
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">Daniele</SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Messaggio originale-----<BR><B>Da:</B> Daniel-Constantin
Mierla [<A class=moz-txt-link-freetext
href="mailto:miconda@gmail.com">mailto:miconda@gmail.com</A>]<BR><B>Inviato:</B>
venerdì 26 marzo 2010 19.40<BR><B>A:</B> Zappasodi Daniele<BR><B>Cc:</B>
<A class=moz-txt-link-abbreviated
href="mailto:users@lists.kamailio.org">users@lists.kamailio.org</A>;
sr-dev<BR><B>Oggetto:</B> Re: R: [Kamailio-Users] Fast lock loop with
arm<BR><BR></FONT></DIV>Hello,<BR><BR>On 3/26/10 4:13 PM, Zappasodi
Daniele wrote:
<BLOCKQUOTE
cite=mid:14A9059A37EF9A45BC2520DE64C30F60075256@slttex002.seltatel.local
type="cite">
<META content="MSHTML 6.00.6000.16981" name=GENERATOR>
<DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-GB>Hello,<O:P></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB>this is
what I get with gdb:<O:P></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-GB><O:P></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB>(gdb) bt
full<O:P></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-GB>#0<SPAN> </SPAN>0x40137e54 in sched_yield () from
/usr/local/lib2/libc.so.6<O:P></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB>No
symbol table info available.<O:P></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-GB><O:P></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB>I don’t
think that it can help, but I am not able to load the symbol table for
openser<SPAN class=292020015-26032010> on the
server</SPAN>.</SPAN></P></DIV></BLOCKQUOTE>hmm, strange. Did you try with
many processes? Sam result in the
backtrace?<BR><BR>Cheers,<BR>Daniel<BR><BR>
<BLOCKQUOTE
cite=mid:14A9059A37EF9A45BC2520DE64C30F60075256@slttex002.seltatel.local
type="cite">
<DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-GB><O:P></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><SPAN
class=292020015-26032010></SPAN></SPAN><SPAN
lang=EN-GB></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><SPAN
class=292020015-26032010><FONT face=Arial color=#0000ff
size=2>thanks,</FONT></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-GB><O:P><SPAN class=292020015-26032010><FONT face=Arial
color=#0000ff size=2>Daniele</FONT></SPAN></O:P></SPAN></P></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Messaggio originale-----<BR><B>Da:</B> Daniel-Constantin
Mierla [<A class=moz-txt-link-freetext href="mailto:miconda@gmail.com"
moz-do-not-send="true">mailto:miconda@gmail.com</A>]<BR><B>Inviato:</B>
mercoledì 24 marzo 2010 16.47<BR><B>A:</B> Zappasodi
Daniele<BR><B>Cc:</B> <A class=moz-txt-link-abbreviated
href="mailto:users@lists.kamailio.org"
moz-do-not-send="true">users@lists.kamailio.org</A>;
sr-dev<BR><B>Oggetto:</B> Re: [Kamailio-Users] Fast lock loop with
arm<BR><BR></FONT></DIV>Hello,<BR><BR>what version of kamailio do you
use?<BR><BR>Can you grab a backtrace with gdb once you get this high
cpu usage? Spot one of the processes, take the pid and
do:<BR><BR>gdb /path/to/kamailio
_pid_<BR><BR>Then:<BR><BR>bt<BR><BR>You should see the bactrace of
executed function getting to deadloc. Make sure you get at least one
SIP worker process backtrace (do kamctl ps to see the type of kamailio
process).<BR><BR>Cheers,<BR>Daniel<BR><BR>On 3/24/10 4:29 PM,
Zappasodi Daniele wrote:
<BLOCKQUOTE
cite=mid:14A9059A37EF9A45BC2520DE64C30F60075252@slttex002.seltatel.local
type="cite">
<META content="MS Exchange Server version 6.5.7654.12"
name=Generator><!-- Converted from text/rtf format -->
<P><SPAN lang=en-gb><FONT face="Times New Roman">Hi,</FONT></SPAN>
<BR><SPAN lang=en-gb><FONT face="Times New Roman">I have a big
problem with fast lock mutex on arm CPU: </FONT></SPAN><BR><SPAN
lang=en-gb><FONT face="Times New Roman">sometimes I find one or more
children that go in an infinite loop, in the while loop of get_lock
function. </FONT></SPAN><BR><SPAN lang=en-gb><FONT
face="Times New Roman">They remain in Run for long time (sometimes
hours) and openser keeps 100% CPU.</FONT></SPAN> </P>
<P><SPAN lang=en-gb><FONT face="Times New Roman">Now I have changed
the functions get_lock and tsl in order to obtain more info and
</FONT></SPAN><BR><SPAN lang=en-gb><FONT face="Times New Roman">I
observe that (if and) when the process finish the cycle, it
have done a big amount of cycles. </FONT></SPAN></P>
<P><SPAN lang=en-gb><FONT face="Times New Roman">This the log with
my added info:</FONT></SPAN> <BR><SPAN lang=en-gb><FONT
face="Times New Roman">Mar 26 20:29:08 SAM-IP openser[1645]:
NOTICE:tm:_lock: ret 1 (cycle)</FONT></SPAN> <BR><SPAN
lang=en-gb><FONT face="Times New Roman">Mar 26 20:29:51 SAM-IP
openser[1645]: NOTICE:tm:_lock: ret 1 (cycle)</FONT></SPAN>
<BR><SPAN lang=en-gb><FONT face="Times New Roman">Mar 26 20:29:55
SAM-IP openser[1645]: NOTICE:tm:_lock: ret 1 (cycle)</FONT></SPAN>
</P>
<P><SPAN lang=en-gb><FONT face="Times New Roman">Mar 26 20:29:55
SAM-IP openser[1645]: NOTICE:tm:t_retransmit_reply: MYTM lock
</FONT></SPAN><BR><SPAN lang=en-gb><FONT
face="Times New Roman">[process in loop]</FONT></SPAN> <BR><SPAN
lang=en-gb><FONT face="Times New Roman">Mar 26 20:33:46 SAM-IP
openser[1645]: NOTICE:tm:_lock: ret 59374917 (cycle)</FONT></SPAN>
<BR><SPAN lang=en-gb><FONT face="Times New Roman">[after 4 minutes
and 59374917 cycles, this is an example with a "short"
loop]</FONT></SPAN> <BR><SPAN lang=en-gb><FONT
face="Times New Roman">Mar 26 20:33:46 SAM-IP openser[1645]:
NOTICE:tm:t_retransmit_reply: MYTM lock done </FONT></SPAN></P>
<P><SPAN lang=en-gb><FONT face="Times New Roman">I’m not able to
recognize the call flow that generates the loop (I know only that it
always happens when t_retransmit_reply calls LOCK_REPLIES),
</FONT></SPAN></P>
<P><SPAN lang=en-gb><FONT face="Times New Roman">but I urgently need
a work around to escape from the loop.</FONT></SPAN> </P>
<P><SPAN lang=en-gb><FONT face="Times New Roman">This is the
get_lock function with my counter j:</FONT></SPAN> </P>
<P><SPAN lang=en-gb><FONT face="Times New Roman">inline static int
get_lock(fl_lock_t* lock)</FONT></SPAN> <BR><SPAN lang=en-gb><FONT
face="Times New Roman">{</FONT></SPAN> <BR><SPAN lang=en-gb><FONT
face="Times New Roman">#ifdef ADAPTIVE_WAIT</FONT></SPAN> <BR><SPAN
lang=en-gb> <FONT
face="Times New Roman">int i=ADAPTIVE_WAIT_LOOPS;</FONT></SPAN>
<BR><SPAN lang=en-gb>
<FONT face="Times New Roman">int
j=1;
/***** my change
****/</FONT></SPAN> <BR><SPAN lang=en-gb><FONT
face="Times New Roman">#endif</FONT></SPAN> <BR><SPAN
lang=en-gb>
</SPAN><BR><SPAN
lang=en-gb> <FONT
face="Times New Roman">while(tsl(lock)){</FONT></SPAN> <BR><SPAN
lang=en-gb><FONT face="Times New Roman">#ifdef
BUSY_WAIT</FONT></SPAN> <BR><SPAN lang=en-gb><FONT
face="Times New Roman">#elif defined ADAPTIVE_WAIT</FONT></SPAN>
<BR><SPAN lang=en-gb>
<FONT
face="Times New Roman">j++;
/***** my change
****/</FONT></SPAN> <BR><SPAN
lang=en-gb>
<FONT
face="Times New Roman">if (i>0) i--;</FONT></SPAN> <BR><SPAN
lang=en-gb>
<FONT
face="Times New Roman">else sched_yield();</FONT></SPAN> <BR><SPAN
lang=en-gb><FONT face="Times New Roman">#else</FONT></SPAN>
<BR><SPAN lang=en-gb>
<FONT
face="Times New Roman">sched_yield();</FONT></SPAN> <BR><SPAN
lang=en-gb><FONT face="Times New Roman">#endif</FONT></SPAN>
<BR><SPAN lang=en-gb>
<FONT face="Times New Roman">}</FONT></SPAN> <BR><SPAN
lang=en-gb> <FONT
face="Times New Roman">return(j);</FONT></SPAN> <BR><SPAN
lang=en-gb><FONT face="Times New Roman">}</FONT></SPAN> </P>
<P><SPAN lang=en-gb><FONT face="Times New Roman">Can I break the
lock when my counter reaches a big value? </FONT></SPAN><BR><SPAN
lang=en-gb><FONT face="Times New Roman">Should I call the unlock
function after the break?</FONT></SPAN> <BR><SPAN lang=en-gb><FONT
face="Times New Roman">which value can be considered too
big?</FONT></SPAN> </P>
<P><SPAN lang=en-gb><FONT
face="Times New Roman">Thanks,</FONT></SPAN> <BR><SPAN
lang=en-gb><FONT face="Times New Roman">Daniele
</FONT></SPAN></P></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE><p>**********************************************************************
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
message
by anyone else is unauthorized. If you are not the intended
recipient, any
disclosure, copying, or distribution of the message, or any action
or
omission taken by you in reliance on it, is prohibited and may be
unlawful.
Please immediately contact the sender if you have received this
message in error.
**********************************************************************</p>
</BODY></HTML>