Author:halw

Date:2010-04-09T17:11:26.000000Z


git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@551 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
halw
2010-04-09 17:11:26 +00:00
parent 41ca803870
commit 755bf0fe3d
3 changed files with 15 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -0,0 +1,3 @@
title=es gt reset tools layout 01
author=halw
path=content/es-gt-reset-tools-layout-01

View File

@@ -26,7 +26,7 @@ feature -- Access
object_per_thread: OBJECT object_per_thread: OBJECT
-- Once per thread. -- Once per thread.
once once ("THREAD")
create Result.make create Result.make
end end
@@ -34,14 +34,22 @@ feature -- Access
-- New 'object' (once per process) -- New 'object' (once per process)
-- that could be shared between threads -- that could be shared between threads
-- without reinitializing it. -- without reinitializing it.
note once ("PROCESS")
once_status: global
once
create Result.make create Result.make
end end
end -- class TEST_ONCE_PER_PROCESS end -- class TEST_ONCE_PER_PROCESS
</code> </code>
Note that if you don't precise any once's key, the default is once per thread. For instance the following once is per thread.
<eiffel>
object_per_thread: OBJECT
-- Once per thread.
once
create Result.make
end
</eiffel>
You can do the same with once procedures. You can do the same with once procedures.