| Предыдущий | Следующий |
| ERROR_INVALID_GW_COMMAND | ERROR_NON_MDICHILD_WINDOW |
ERROR_INVALID_THREAD_ID
Что означает ERROR_INVALID_THREAD_ID
ERROR_INVALID_THREAD_ID — недопустимый идентификатор потока.
Что проверить
Зафиксируйте поток и вызов, на котором появился код, а также состояние потока до и после операции.
- Проверьте срок жизни контекста обратного вызова, порядок завершения потока и наличие ожидающих APC или уведомлений, если они участвуют в сценарии.
- При гонке или зависании снимите стеки участвующих потоков: обычный повтор часто только меняет расписание и скрывает причину.
Исходная формулировка
A USER32 operation received an invalid or stale thread identifier.
For PostThreadMessage , remember that the destination thread must have a message queue. Creating the thread does not alone guarantee that queue exists. Have the target call PeekMessage during initialization, signal readiness afterward, and define how shutdown rejects later posts.
A controller restarts its UI worker but leaves the old thread ID in a queue producer. Messages sent after restart fail with 1444. Storing the worker generation together with the ID and updating producers only after the new queue is ready prevents delivery to stale identities.
posting to a worker before it has created a message queue
GetWindowThreadProcessId returns a thread ID and can separately fill a process ID; mixing the two outputs is an easy error.
Технические ссылки
- Microsoft: System Error Codes (1300–1699)
- Microsoft: GetWindowThreadProcessId
- Microsoft: PostThreadMessage
Нужно найти другой код? Найти другой код состояния или ошибки.