Created On:  13 January 2011


A multi-threaded application returns this error without a real reason: "RECEIVE/WAIT in locked thread - deadlocked". This error began to occur after the upgrade to runtime version 8.1.0. Earlier runtimes the application did not encounter the error.


This error is usually shown when:

- the application is executing either a RECEIVE or a WAIT statement
- the current thread has no messages and it appears as locked.

The tread may be locked for one of the following reasons:

- a LOCK THREAD statement
- INPUT-OUTPUT operations on a file
- event procedure of a GRID control (ECN-3671)

ECN 3671 has been introduced in release 8.1.0. This is its description:

SUBJECT: Threads and event procedures

Change Number: ECN-3671
Status: Complete
Type of Change: Correction
Priority: Medium
Incidents: 99-047136
Date: 2007-04-11
Module: runtime
New Version: 8.1.0
Machines Affected: All
Known Versions Affected: All

DESCRIPTION of problem or enhancement:

In response to a grid PAGE event, the runtime may generate many NEXT RECORD events. When it does so, a thread switch may cause the runtime to get into an inconsistent state.


Install the new runtime. When the runtime generates event for NEXT RECORD, it will lock the current thread for the duration of the event procedure. Note that if you have code in your event procedure for filling a grid which relies on other threads running, you may have trouble. If so, you can turn this locking off by setting the configuration variable ECN-3671 to FALSE.

This ECN can be the cause of the error message and can be turned off by setting this configuration variable: ECN-3671 FALSE
Incident #2493872