Xojo Conferences
XDCMay2019MiamiUSA

Da heck is an IllegalLockingException?? (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Updating Ubuntu - was Re: Use of Parallels
Next thread: Wrapping and subclassing... pros and cons.


Reading *CSV Files versus *.Txt Files   -   Claude Stone
  Da heck is an IllegalLockingException??   -   Kimball Larsen
   Re: Da heck is an IllegalLockingException??   -   Charles Yeomans
   Re: Da heck is an IllegalLockingException??   -   Kimball Larsen
   Re: Da heck is an IllegalLockingException??   -   Charles Yeomans
   Re: Da heck is an IllegalLockingException??   -   Kimball Larsen
   Re: Da heck is an IllegalLockingException??   -   Tim Jones
   Re: Da heck is an IllegalLockingException??   -   Charles Yeomans
   Re: Da heck is an IllegalLockingException??   -   Kimball Larsen
   Re: Da heck is an IllegalLockingException??   -   Kimball Larsen
   Re: Da heck is an IllegalLockingException??   -   Kimball Larsen

Da heck is an IllegalLockingException??
Date: 27.01.09 18:41 (Tue, 27 Jan 2009 10:41:11 -0700)
From: Kimball Larsen
I've asked this once before (last year sometime) but never got any
responses... I'm hoping that someone can enlighten me.

What is an IllegalLockingException? It is undocumented, never
explained in any resources I've managed to find, and is making me
loose hair.

Here is what is causing it: In my app class I've added a property
called "LatestVersionCheckCriticalSection as CriticalSection". In
app.startup I instantiate it to a new CriticalSection.

Later, when my app is running, I have a thread that is used to check
online to see if there is a newer version of my app available. This
thread calls app.latestVersionCheckCriticalSection.tryEnter and then
fires off a request to a socket. In the pageReceived event of the
socket, I've got a call to
app.latestVersionCheckCriticalSection.leave. It is on this leave call
that the debugger is whining about an IllegalLockingException.

Based on what the language ref says about CriticalSection, I thought I
was doing this correctly. Where have I fouled up?

Thanks!

- Kimball
http://www.kimballlarsen.com

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Da heck is an IllegalLockingException??
Date: 27.01.09 18:58 (Tue, 27 Jan 2009 12:58:13 -0500)
From: Charles Yeomans

On Jan 27, 2009, at 12:41 PM, Kimball Larsen wrote:

> I've asked this once before (last year sometime) but never got any
> responses... I'm hoping that someone can enlighten me.
>
> What is an IllegalLockingException? It is undocumented, never
> explained in any resources I've managed to find, and is making me
> loose hair.
>
> Here is what is causing it: In my app class I've added a property
> called "LatestVersionCheckCriticalSection as CriticalSection". In
> app.startup I instantiate it to a new CriticalSection.
>
> Later, when my app is running, I have a thread that is used to check
> online to see if there is a newer version of my app available. This
> thread calls app.latestVersionCheckCriticalSection.tryEnter and then
> fires off a request to a socket. In the pageReceived event of the
> socket, I've got a call to
> app.latestVersionCheckCriticalSection.leave. It is on this leave
> call that the debugger is whining about an IllegalLockingException.
>
> Based on what the language ref says about CriticalSection, I thought
> I was doing this correctly. Where have I fouled up?

Probably the big mistake is to use a CriticalSection :)

An IllegalLockingException is being raised because you're calling
Leave from a thread different than the one that called Enter.

Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Da heck is an IllegalLockingException??
Date: 27.01.09 19:17 (Tue, 27 Jan 2009 11:17:01 -0700)
From: Kimball Larsen

On Jan 27, 2009, at 10:58 AM, Charles Yeomans wrote:

>
> On Jan 27, 2009, at 12:41 PM, Kimball Larsen wrote:
>
>> I've asked this once before (last year sometime) but never got any
>> responses... I'm hoping that someone can enlighten me.
>>
>> What is an IllegalLockingException? It is undocumented, never
>> explained in any resources I've managed to find, and is making me
>> loose hair.
>>
>> Here is what is causing it: In my app class I've added a property
>> called "LatestVersionCheckCriticalSection as CriticalSection". In
>> app.startup I instantiate it to a new CriticalSection.
>>
>> Later, when my app is running, I have a thread that is used to
>> check online to see if there is a newer version of my app
>> available. This thread calls
>> app.latestVersionCheckCriticalSection.tryEnter and then fires off a
>> request to a socket. In the pageReceived event of the socket, I've
>> got a call to app.latestVersionCheckCriticalSection.leave. It is
>> on this leave call that the debugger is whining about an
>> IllegalLockingException.
>>
>> Based on what the language ref says about CriticalSection, I
>> thought I was doing this correctly. Where have I fouled up?
>
> Probably the big mistake is to use a CriticalSection :)
>
> An IllegalLockingException is being raised because you're calling
> Leave from a thread different than the one that called Enter.
>
> Charles Yeomans
>

ok, thanks for clarifying. Here is why I am trying to do it this
way: I have a thread that creates the socket and calls socket.get to
hit the URL that will tell me if there is a newer version or not.
Now, since the get method is a) asynchronous and b) the pageReceived
event handler happens in the main event loop, it is impossible (as far
as I can tell) to keep everything in the original thread, as the
pageReceived event will fire in the main thread no matter what I do.
I need to leave the critical section in the pageReceived event.

Should I be using something with a broader scope such as mutex? Seems
overkill just to protect a single thread....

And lest you should hope to say "hey, you don't need a criticalSection
around something silly like a version check, dummy!" I'll interject
that I plan to use this pattern for lots of interaction with my
webservices, some of which can happen as the app is shutting down, and
I was planning to use critical sections to prevent the app from
completely exiting before the interactions with my webservices
finish. Do I need to approach this differently?

Thanks!

- Kimball
http://www.kimballlarsen.com



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Da heck is an IllegalLockingException??
Date: 27.01.09 19:35 (Tue, 27 Jan 2009 13:35:06 -0500)
From: Charles Yeomans

On Jan 27, 2009, at 1:17 PM, Kimball Larsen wrote:

>
> On Jan 27, 2009, at 10:58 AM, Charles Yeomans wrote:
>
>>
>> On Jan 27, 2009, at 12:41 PM, Kimball Larsen wrote:
>>
>>> I've asked this once before (last year sometime) but never got any
>>> responses... I'm hoping that someone can enlighten me.
>>>
>>> What is an IllegalLockingException? It is undocumented, never
>>> explained in any resources I've managed to find, and is making me
>>> loose hair.
>>>
>>> Here is what is causing it: In my app class I've added a property
>>> called "LatestVersionCheckCriticalSection as CriticalSection". In
>>> app.startup I instantiate it to a new CriticalSection.
>>>
>>> Later, when my app is running, I have a thread that is used to
>>> check online to see if there is a newer version of my app
>>> available. This thread calls
>>> app.latestVersionCheckCriticalSection.tryEnter and then fires off
>>> a request to a socket. In the pageReceived event of the socket,
>>> I've got a call to app.latestVersionCheckCriticalSection.leave.
>>> It is on this leave call that the debugger is whining about an
>>> IllegalLockingException.
>>>
>>> Based on what the language ref says about CriticalSection, I
>>> thought I was doing this correctly. Where have I fouled up?
>>
>> Probably the big mistake is to use a CriticalSection :)
>>
>> An IllegalLockingException is being raised because you're calling
>> Leave from a thread different than the one that called Enter.
>>
>> Charles Yeomans
>>
> ok, thanks for clarifying. Here is why I am trying to do it this
> way: I have a thread that creates the socket and calls socket.get
> to hit the URL that will tell me if there is a newer version or
> not. Now, since the get method is a) asynchronous and b) the
> pageReceived event handler happens in the main event loop, it is
> impossible (as far as I can tell) to keep everything in the original
> thread, as the pageReceived event will fire in the main thread no
> matter what I do. I need to leave the critical section in the
> pageReceived event.
>
> Should I be using something with a broader scope such as mutex?
> Seems overkill just to protect a single thread....
>
> And lest you should hope to say "hey, you don't need a
> criticalSection around something silly like a version check, dummy!"
> I'll interject that I plan to use this pattern for lots of
> interaction with my webservices, some of which can happen as the app
> is shutting down, and I was planning to use critical sections to
> prevent the app from completely exiting before the interactions with
> my webservices finish. Do I need to approach this differently?

I think so; it is not clear to me what you're trying to protect. Try
this. Provide the socket with a reference to the thread. Have the
thread call GET, then go to sleep. In the socket's PageReceived
handler, have it wake the thread up.

Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Da heck is an IllegalLockingException??
Date: 27.01.09 20:06 (Tue, 27 Jan 2009 12:06:28 -0700)
From: Kimball Larsen


On Jan 27, 2009, at 11:35 AM, Charles Yeomans wrote:

>
> On Jan 27, 2009, at 1:17 PM, Kimball Larsen wrote:
>
>>
>> On Jan 27, 2009, at 10:58 AM, Charles Yeomans wrote:
>>
>>>
>>> On Jan 27, 2009, at 12:41 PM, Kimball Larsen wrote:
>>>
>>>> I've asked this once before (last year sometime) but never got
>>>> any responses... I'm hoping that someone can enlighten me.
>>>>
>>>> What is an IllegalLockingException? It is undocumented, never
>>>> explained in any resources I've managed to find, and is making me
>>>> loose hair.
>>>>
>>>> Here is what is causing it: In my app class I've added a property
>>>> called "LatestVersionCheckCriticalSection as CriticalSection".
>>>> In app.startup I instantiate it to a new CriticalSection.
>>>>
>>>> Later, when my app is running, I have a thread that is used to
>>>> check online to see if there is a newer version of my app
>>>> available. This thread calls
>>>> app.latestVersionCheckCriticalSection.tryEnter and then fires off
>>>> a request to a socket. In the pageReceived event of the socket,
>>>> I've got a call to app.latestVersionCheckCriticalSection.leave.
>>>> It is on this leave call that the debugger is whining about an
>>>> IllegalLockingException.
>>>>
>>>> Based on what the language ref says about CriticalSection, I
>>>> thought I was doing this correctly. Where have I fouled up?
>>>
>>> Probably the big mistake is to use a CriticalSection :)
>>>
>>> An IllegalLockingException is being raised because you're calling
>>> Leave from a thread different than the one that called Enter.
>>>
>>> Charles Yeomans
>>>
>> ok, thanks for clarifying. Here is why I am trying to do it this
>> way: I have a thread that creates the socket and calls socket.get
>> to hit the URL that will tell me if there is a newer version or
>> not. Now, since the get method is a) asynchronous and b) the
>> pageReceived event handler happens in the main event loop, it is
>> impossible (as far as I can tell) to keep everything in the
>> original thread, as the pageReceived event will fire in the main
>> thread no matter what I do. I need to leave the critical section
>> in the pageReceived event.
>>
>> Should I be using something with a broader scope such as mutex?
>> Seems overkill just to protect a single thread....
>>
>> And lest you should hope to say "hey, you don't need a
>> criticalSection around something silly like a version check,
>> dummy!" I'll interject that I plan to use this pattern for lots of
>> interaction with my webservices, some of which can happen as the
>> app is shutting down, and I was planning to use critical sections
>> to prevent the app from completely exiting before the interactions
>> with my webservices finish. Do I need to approach this differently?
>
> I think so; it is not clear to me what you're trying to protect.
> Try this. Provide the socket with a reference to the thread. Have
> the thread call GET, then go to sleep. In the socket's PageReceived
> handler, have it wake the thread up.
>
> Charles Yeomans

Your suggestion seems like a great idea, but I can't seem to get it
working. Before I file a bug, I want to make sure that I'm doing the
suspend/resume correctly on my thread.

In my thread.run:

app.LatestVersionCheckCriticalSection.enter
<snip> - do a bunch of stuff to get the version of the current app,
check some preferences, etc.</snip>
dim s as new LatestVersionCheckSocket
s.myThread = me
s.get("https://www.supersecret.com/WebServices/interface.php?request_type=latestVersion
")
me.suspend
app.LatestVersionCheckCriticalSection.leave

Then in my pageReceived event in the socket, I'm calling
myThread.resume

Putting breakpoints in both the thread and the socket, I see that the
thread enters the critical section, then calls get and suspends
correctly, then the socket pageReceived event fires and
myThread.resume is hit, then the thread wakes back up and hits
app.latestVersionCheckCriticalSection.leave, supposedly leaving the
critical section. Running through the process again on the same run
of the app, the thread sits on the
app.latestVersionCheckCriticalSection.enter forever - as though the
criticalSection was never exited by the prior run through this code.

I've also tried me.sleep, but the language reference seems to indicate
that I should be using me.suspend to get the thread to pause, and then
resume to get it to go again. Did I find a bug? Or am I _still_
doing something wrong?

Thanks!

- Kimball
http://www.kimballlarsen.com

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Da heck is an IllegalLockingException??
Date: 27.01.09 20:13 (Tue, 27 Jan 2009 12:13:07 -0700)
From: Tim Jones
On Jan 27, 2009, at 11:17 AM, Kimball Larsen wrote:

> Should I be using something with a broader scope such as mutex?
> Seems overkill just to protect a single thread....

Maybe I've taken too simplistic an approach, but I just use a global
method that I can call at startup or allow the user to call manually
form the Help menu:

Function CheckForUpdate As Boolean
Dim http As New HTTPSocket
Dim Version As String
Dim i As Integer

http.yield = True

LEVersion = App.ShortVersion

If NetworkAvailableMBS("www.tolisgroup.com") Then
Debug.print "Local Version is " + Chr(34) + LEVersion + Chr(34)
If BRUType = "BRU LE" Then
Version = http.Get("http://www.tolisgroup.com/leversion.html",
30)
Else
Version = http.Get("http://www.tolisgroup.com/peversion.html",
30)
End If
WebVersion = NthField(NthField(Version, EndOfLine.UNIX, 1), ":
", 2)
i = StrComp(LEVersion, WebVersion, 1)
Debug.print "StrComp(LEVersion, WebVersion, 1) = " + Str(i)
If i < 0 Then
UpdateAvailable = True
Else
UpdateAvailable = False
End If
Return UpdateAvailable
Else
Return False
End If
End Function

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Da heck is an IllegalLockingException??
Date: 27.01.09 20:18 (Tue, 27 Jan 2009 14:18:15 -0500)
From: Charles Yeomans

On Jan 27, 2009, at 2:06 PM, Kimball Larsen wrote:

>
> On Jan 27, 2009, at 11:35 AM, Charles Yeomans wrote:
>
>>
>> On Jan 27, 2009, at 1:17 PM, Kimball Larsen wrote:
>>
>>>
>>> On Jan 27, 2009, at 10:58 AM, Charles Yeomans wrote:
>>>
>>>>
>>>> On Jan 27, 2009, at 12:41 PM, Kimball Larsen wrote:
>>>>
>>>>> I've asked this once before (last year sometime) but never got
>>>>> any responses... I'm hoping that someone can enlighten me.
>>>>>
>>>>> What is an IllegalLockingException? It is undocumented, never
>>>>> explained in any resources I've managed to find, and is making
>>>>> me loose hair.
>>>>>
>>>>> Here is what is causing it: In my app class I've added a
>>>>> property called "LatestVersionCheckCriticalSection as
>>>>> CriticalSection". In app.startup I instantiate it to a new
>>>>> CriticalSection.
>>>>>
>>>>> Later, when my app is running, I have a thread that is used to
>>>>> check online to see if there is a newer version of my app
>>>>> available. This thread calls
>>>>> app.latestVersionCheckCriticalSection.tryEnter and then fires
>>>>> off a request to a socket. In the pageReceived event of the
>>>>> socket, I've got a call to
>>>>> app.latestVersionCheckCriticalSection.leave. It is on this
>>>>> leave call that the debugger is whining about an
>>>>> IllegalLockingException.
>>>>>
>>>>> Based on what the language ref says about CriticalSection, I
>>>>> thought I was doing this correctly. Where have I fouled up?
>>>>
>>>> Probably the big mistake is to use a CriticalSection :)
>>>>
>>>> An IllegalLockingException is being raised because you're calling
>>>> Leave from a thread different than the one that called Enter.
>>>>
>>>> Charles Yeomans
>>>>
>>>
>>> ok, thanks for clarifying. Here is why I am trying to do it this
>>> way: I have a thread that creates the socket and calls socket.get
>>> to hit the URL that will tell me if there is a newer version or
>>> not. Now, since the get method is a) asynchronous and b) the
>>> pageReceived event handler happens in the main event loop, it is
>>> impossible (as far as I can tell) to keep everything in the
>>> original thread, as the pageReceived event will fire in the main
>>> thread no matter what I do. I need to leave the critical section
>>> in the pageReceived event.
>>>
>>> Should I be using something with a broader scope such as mutex?
>>> Seems overkill just to protect a single thread....
>>>
>>> And lest you should hope to say "hey, you don't need a
>>> criticalSection around something silly like a version check,
>>> dummy!" I'll interject that I plan to use this pattern for lots of
>>> interaction with my webservices, some of which can happen as the
>>> app is shutting down, and I was planning to use critical sections
>>> to prevent the app from completely exiting before the interactions
>>> with my webservices finish. Do I need to approach this differently?
>>
>> I think so; it is not clear to me what you're trying to protect.
>> Try this. Provide the socket with a reference to the thread. Have
>> the thread call GET, then go to sleep. In the socket's PageReceived
>> handler, have it wake the thread up.
>>
>> Charles Yeomans
>
> Your suggestion seems like a great idea, but I can't seem to get it
> working. Before I file a bug, I want to make sure that I'm doing
> the suspend/resume correctly on my thread.
>
> In my thread.run:
>
> app.LatestVersionCheckCriticalSection.enter
> <snip> - do a bunch of stuff to get the version of the current app,
> check some preferences, etc.</snip>
> dim s as new LatestVersionCheckSocket
> s.myThread = me
> s.get("https://www.supersecret.com/WebServices/interface.php?request_type=latestVersion
> ")
> me.suspend
> app.LatestVersionCheckCriticalSection.leave
>
> Then in my pageReceived event in the socket, I'm calling
> myThread.resume
>
> Putting breakpoints in both the thread and the socket, I see that
> the thread enters the critical section, then calls get and suspends
> correctly, then the socket pageReceived event fires and
> myThread.resume is hit, then the thread wakes back up and hits
> app.latestVersionCheckCriticalSection.leave, supposedly leaving the
> critical section. Running through the process again on the same run
> of the app, the thread sits on the
> app.latestVersionCheckCriticalSection.enter forever - as though the
> criticalSection was never exited by the prior run through this code.
>
> I've also tried me.sleep, but the language reference seems to
> indicate that I should be using me.suspend to get the thread to
> pause, and then resume to get it to go again. Did I find a bug? Or
> am I _still_ doing something wrong?
>

Sorry; my suggestion wasn't clear enough. Get rid of the critical
section stuff as well.

Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Da heck is an IllegalLockingException??
Date: 27.01.09 20:18 (Tue, 27 Jan 2009 12:18:27 -0700)
From: Kimball Larsen
>>

*smacks forehead*

>>
>> I think so; it is not clear to me what you're trying to protect.
>> Try this. Provide the socket with a reference to the thread. Have
>> the thread call GET, then go to sleep. In the socket's PageReceived
>> handler, have it wake the thread up.
>>
>> Charles Yeomans
>
> Your suggestion seems like a great idea, but I can't seem to get it
> working. Before I file a bug, I want to make sure that I'm doing
> the suspend/resume correctly on my thread.
>
> In my thread.run:
>
> app.LatestVersionCheckCriticalSection.enter
> <snip> - do a bunch of stuff to get the version of the current app,
> check some preferences, etc.</snip>
> dim s as new LatestVersionCheckSocket
> s.myThread = me
> s.get("https://www.supersecret.com/WebServices/interface.php?request_type=latestVersion
> ")
> me.suspend
> app.LatestVersionCheckCriticalSection.leave
>
> Then in my pageReceived event in the socket, I'm calling
> myThread.resume
>
> Putting breakpoints in both the thread and the socket, I see that
> the thread enters the critical section, then calls get and suspends
> correctly, then the socket pageReceived event fires and
> myThread.resume is hit, then the thread wakes back up and hits
> app.latestVersionCheckCriticalSection.leave, supposedly leaving the
> critical section. Running through the process again on the same run
> of the app, the thread sits on the
> app.latestVersionCheckCriticalSection.enter forever - as though the
> criticalSection was never exited by the prior run through this code.
>
> I've also tried me.sleep, but the language reference seems to
> indicate that I should be using me.suspend to get the thread to
> pause, and then resume to get it to go again. Did I find a bug? Or
> am I _still_ doing something wrong?
>
> Thanks!

I had an extra call to app.LatestVersionCheckCriticalSection.enter in
the menu handler that fired the thread. Doh!

This, my friends, is why Charles gets paid the Big Bucks™.

Thanks!

- Kimball
http://www.kimballlarsen.com

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Da heck is an IllegalLockingException??
Date: 27.01.09 20:25 (Tue, 27 Jan 2009 12:25:26 -0700)
From: Kimball Larsen


On Jan 27, 2009, at 12:13 PM, Tim Jones wrote:

> On Jan 27, 2009, at 11:17 AM, Kimball Larsen wrote:
>
>> Should I be using something with a broader scope such as mutex?
>> Seems overkill just to protect a single thread....
>
> Maybe I've taken too simplistic an approach, but I just use a global
> method that I can call at startup or allow the user to call manually
> form the Help menu:
>
> Function CheckForUpdate As Boolean
> Dim http As New HTTPSocket
> Dim Version As String
> Dim i As Integer
>
> http.yield = True
>
> LEVersion = App.ShortVersion
>
> If NetworkAvailableMBS("www.tolisgroup.com") Then
> Debug.print "Local Version is " + Chr(34) + LEVersion + Chr(34)
> If BRUType = "BRU LE" Then
> Version = http.Get("http://www.tolisgroup.com/leversion.html",
> 30)
> Else
> Version = http.Get("http://www.tolisgroup.com/peversion.html",
> 30)
> End If
> WebVersion = NthField(NthField(Version, EndOfLine.UNIX, 1), ": ",
> 2)
> i = StrComp(LEVersion, WebVersion, 1)
> Debug.print "StrComp(LEVersion, WebVersion, 1) = " + Str(i)
> If i < 0 Then
> UpdateAvailable = True
> Else
> UpdateAvailable = False
> End If
> Return UpdateAvailable
> Else
> Return False
> End If
> End Function
>

Your approach works great if you can use HTTPSocket. I'm using
HTTPSecureSocket, which for some reason known only to the RealBasic
Gods does not implement the get method with a timeout to have it run
synchronously. This would, obviously, solve a LOT of my problems.

My app needs to interact with a large set of webservices, many of
which involve transmitting confidential data, so I have to use a
secure socket.

Thanks for the suggestion, though!

- Kimball
http://www.kimballlarsen.com

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Da heck is an IllegalLockingException??
Date: 27.01.09 20:32 (Tue, 27 Jan 2009 12:32:42 -0700)
From: Kimball Larsen
>>>
>>>
>>> I think so; it is not clear to me what you're trying to protect.
>>> Try this. Provide the socket with a reference to the thread.
>>> Have the thread call GET, then go to sleep. In the socket's
>>> PageReceived handler, have it wake the thread up.
>>>
>>> Charles Yeomans
>>
> Sorry; my suggestion wasn't clear enough. Get rid of the critical
> section stuff as well.
>
> Charles Yeomans

Your suggestion was plenty clear, and works great now that I'm using
the correct number of calls to enter and leave. I am leaving the
critical section stuff there because I need to prevent the app from
exiting if any of my webservices processes are running. So, I'm
wrapping them all in criticalSections and will have the app.shutdown
do a tryEnter on them until it can get access, thus letting me shut
down cleanly.

Thanks!

-- Kimball

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>