comp.lang.ada
 help / color / mirror / Atom feed
* pragma Thread_Local_Storage on record?
@ 2016-03-01 13:45 hanslad
  2016-03-01 14:44 ` Florian Weimer
  2016-03-01 15:52 ` J-P. Rosen
  0 siblings, 2 replies; 7+ messages in thread
From: hanslad @ 2016-03-01 13:45 UTC (permalink / raw)



Hello,
 I am trying to use the pragma Thread_Local_Storage on a record as follows:
In specification file:

...
   package Local_Buffers is new Buffers(Any_Worker);
   package Local_Mailboxes is new Local_Buffers.Mailboxes;
   use Local_Buffers;
   use Local_Mailboxes;
   
   type Core is record
      Wait_Queue : Any_Buffer;
      Core_No    : UInt32;
      Current    : WorkerId ;
      Parent     : WorkerId ;
      Msgs       : UInt64;
   end record;
...

and body file goes like this:

...

   Curr_Core : Core;
   pragma Volatile(Curr_Core);
   pragma Thread_Local_Storage( Curr_Core);
...

I get the following errors:

cores.adb:27:04: Thread_Local_Storage variable "Curr_Core" is improperly initialized
cores.adb:27:04: only allowed initialization is explicit "null" or static expression

What am I doing wrong here?
If the code snippets I provided is not sufficient for to see the real problem, please give me a hint and I will provide more code.

Thanks!

HP 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-03-01 17:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-01 13:45 pragma Thread_Local_Storage on record? hanslad
2016-03-01 14:44 ` Florian Weimer
2016-03-01 15:22   ` hanslad
2016-03-01 15:55     ` Dmitry A. Kazakov
2016-03-01 16:31       ` hanslad
2016-03-01 17:03         ` Dmitry A. Kazakov
2016-03-01 15:52 ` J-P. Rosen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox