Re: interrupt dependencies.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



i tried a solution ..

int A
{
spin_lock a
x=0
func A()
x=1;
spin_unlock a
}

int B
{
      done = false;
      while(done == false)
      {
             spin_lock a;
             if(x==1){
               func B()
                spin_unlock a;
                done = true;
            }
            else if(x==0)  {
                 spin_unlock a;
            }
       }//while
}

On Tue, Feb 9, 2010 at 2:03 AM, Andrea Gasparini <gaspa@xxxxxxxxxxx> wrote:
In data lunedì 08 febbraio 2010 17:50:29, Mulyadi Santosa ha scritto:
> First idea that crosses my mind is:
>
> create an atomic (maybe 64 bit one?) counter. Increase it every time
> funcA() is executed. then, create same type of counter, let;s name it
> old_counter...
<snip>

LOL, Exactly what I tried. In fact it works, I just hoped that there was any
common "design pattern", but seems not.

Thanks a lot, bye!
--
-gaspa-
-----------------------------------------------
--------- http://launchpad.net/~gaspa ---------
------- HomePage: gaspa.yattaweb.it --------
-Il lunedi'dell'arrampicatore: www.lunedi.org -

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ




--
Thanks & Regards
Nidhi Mittal Hada

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux