This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Atomic operations
- To: <ecos-discuss at sourceware dot cygnus dot com>
- Subject: [ECOS] Atomic operations
- From: "Boris V. Guzhov" <borg at int dot spb dot ru>
- Date: Tue, 8 Aug 2000 16:04:21 +0400
Hi All!
My target is pc386. There is a question.
I want to make an atomic a little code sequence in a thread.
For example:
static int resource;
if ( resource <0) {
return -1;
}
resource --;
The resource variable can vary in other threads and in in interrupt
handlers.
I can use cyg_sheduler_(un)lock() or a mutex etc.
But I think that these solutions are expensive for little code sequences.
Is there in eCos a something similar to simple CPU masking?
Thanks in advance.
--
Boris Guzhov,
St.Petersburg, Russia