1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

[220446] Updated Excercise 4 comments.

This commit is contained in:
Pawel Piech 2008-03-12 19:16:54 +00:00
parent 681323f895
commit b36441f7f9
2 changed files with 46 additions and 23 deletions

View file

@ -50,7 +50,8 @@ import org.eclipse.dd.examples.dsf.DsfExamplesPlugin;
* </p>
*/
//#ifdef excercises
// TODO Excercise 4 - Add an annotationindicating allowed concurrency access
//TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
//indicating allowed thread access to this class/method/member
//#else
//#@ThreadSafe
//#endif
@ -73,7 +74,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
}
//#ifdef excercises
// TODO Excercise 4 - Add an annotationindicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#else
//# @Immutable
//#endif
@ -84,7 +86,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
}
//#ifdef excercises
// TODO Excercise 4 - Add an annotationindicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#else
//# @Immutable
//#endif
@ -98,7 +101,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
// The executor used to access all internal data of the generator.
//#ifdef excercises
// TODO Excercise 4 - Add an annotation indicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
// Hint: If a member does not have an annotation, the programmer can assume
// that the concurrency rule that applies to the class also applies to this
// member.
@ -110,7 +114,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
// method reads from it.
// The executor used to access all internal data of the generator.
//#ifdef excercises
// TODO Excercise 4 - Add an annotationindicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#else
//# @ConfinedToDsfExecutor("fExecutor")
//#endif
@ -119,7 +124,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
// List of listeners is not synchronized, it also has to be accessed
// using the executor.
//#ifdef excercises
// TODO Excercise 4 - Add an annotationindicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#else
//# @ConfinedToDsfExecutor("fExecutor")
//#endif
@ -127,7 +133,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
// Current number of elements in this generator.
//#ifdef excercises
// TODO Excercise 4 - Add an annotationindicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#else
//# @ConfinedToDsfExecutor("fExecutor")
//#endif
@ -135,7 +142,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
// Counter used to determine when to reset the element count.
//#ifdef excercises
// TODO Excercise 4 - Add an annotationindicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#else
//# @ConfinedToDsfExecutor("fExecutor")
//#endif
@ -143,7 +151,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
// Elements which were modified since the last reset.
//#ifdef excercises
// TODO Excercise 4 - Add an annotationindicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#else
//# @ConfinedToDsfExecutor("fExecutor")
//#endif
@ -151,14 +160,16 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
// Flag used to ensure that requests are processed sequentially.
//#ifdef excercises
// TODO Excercise 4 - Add an annotationindicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#else
//# @ConfinedToDsfExecutor("fExecutor")
//#endif
private boolean fServiceQueueInProgress = false;
//#ifdef excercises
// TODO Excercise 4 - Add an annotation indicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#endif
public DataGeneratorWithExecutor() {
// Create the executor
@ -177,7 +188,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
}
//#ifdef excercises
// TODO Excercise 4 - Add an annotation indicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#endif
public void shutdown(final RequestMonitor rm) {
try {
@ -203,7 +215,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
}
//#ifdef excercises
// TODO Excercise 4 - Add an annotation indicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#endif
public void getCount(final DataRequestMonitor<Integer> rm) {
try {
@ -220,7 +233,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
}
//#ifdef excercises
// TODO Excercise 4 - Add an annotation indicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#endif
public void getValue(final int index, final DataRequestMonitor<String> rm) {
try {
@ -237,7 +251,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
}
//#ifdef excercises
// TODO Excercise 4 - Add an annotation indicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#endif
public void addListener(final Listener listener) {
try {
@ -250,7 +265,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
}
//#ifdef excercises
// TODO Excercise 4 - Add an annotation indicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#endif
public void removeListener(final Listener listener) {
try {
@ -264,7 +280,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
// Main processing function of this generator.
//#ifdef excercises
// TODO Excercise 4 - Add an annotationindicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#else
//# @ConfinedToDsfExecutor("fExecutor")
//#endif
@ -319,7 +336,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
}
//#ifdef excercises
// TODO Excercise 4 - Add an annotationindicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#else
//# @ConfinedToDsfExecutor("fExecutor")
//#endif
@ -332,7 +350,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
}
//#ifdef excercises
// TODO Excercise 4 - Add an annotationindicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#else
//# @ConfinedToDsfExecutor("fExecutor")
//#endif
@ -352,7 +371,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
* This method simulates changes in the supplier's data set.
*/
//#ifdef excercises
// TODO Excercise 4 - Add an annotationindicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#else
//# @ConfinedToDsfExecutor("fExecutor")
//#endif
@ -370,7 +390,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
* Calculates new size for provider's data set.
*/
//#ifdef excercises
// TODO Excercise 4 - Add an annotationindicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#else
//# @ConfinedToDsfExecutor("fExecutor")
//#endif
@ -392,7 +413,8 @@ public class DataGeneratorWithExecutor implements IDataGenerator {
* Invalidates a random range of indexes.
*/
//#ifdef excercises
// TODO Excercise 4 - Add an annotationindicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#else
//# @ConfinedToDsfExecutor("fExecutor")
//#endif

View file

@ -30,7 +30,8 @@ import org.eclipse.dd.dsf.concurrent.RequestMonitor;
* is changed.
*/
//#ifdef excercises
//TODO Excercise 4 - Add an annotationindicating allowed concurrency access
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
// indicating allowed thread access to this class/method/member
//#else
//#@ThreadSafe
//#endif