Click here to Skip to main content
13,795,046 members

C / C++ / MFC

 
AnswerRe: Calculating decimal places - Pin
ptr_Electron16-Oct-18 3:55
memberptr_Electron16-Oct-18 3:55 
GeneralRe: Calculating decimal places - Pin
CPallini16-Oct-18 4:11
mvpCPallini16-Oct-18 4:11 
QuestionMessage Closed Pin
15-Oct-18 0:32
memberMember 1397497715-Oct-18 0:32 
QuestionUsing assignment operator = for a class with const memeber variables? Pin
Member 140109547-Oct-18 13:52
memberMember 140109547-Oct-18 13:52 
AnswerRe: Using assignment operator = for a class with const memeber variables? Pin
CPallini7-Oct-18 21:36
mvpCPallini7-Oct-18 21:36 
AnswerRe: Using assignment operator = for a class with const memeber variables? Pin
Richard MacCutchan7-Oct-18 22:47
protectorRichard MacCutchan7-Oct-18 22:47 
AnswerRe: Using assignment operator = for a class with const memeber variables? Pin
«_Superman_»9-Oct-18 2:51
professional«_Superman_»9-Oct-18 2:51 
QuestionAccess a pointer value changed in another class Pin
meerokh5-Oct-18 7:30
membermeerokh5-Oct-18 7:30 
For synchronization purpose, I am implementing a wait function that is gonna wait until a package is executed.

I have following code in user application
bool finished;
function(){
int id = createpackage(&finished);// user creates a package(basically another function) for the execution
wait(&finished)//if i need to wait for the result of above created package
// do remaining stuff
}

Inside the library(i am developing), i am trying to do this
package.cpp
createpackage(bool* finished){
*finished = false;
package pack(function, arguments, finished);// this calls the constructor of package

//package contructor
package::package(){
//other memeber variables inside ctor
m_packagefinished = *finished; // As package is being created so finished = false

void package::setHandle(){
lock
//i am not sure how to set the value of finished to true so that it reflect the change when i access it in wait(). Any ideas??
unlock
}

}


In another class i am executing the package and want to set the m_finished to true after packge is being executed.
packageinstance.execute();
packageinstance.setHandle();//

Wait function(implemented in a different class) is as follows:
wait(bool * finished){
while(*finished == false)
yeild(); //If the package is not being executed yet, yeild to another package and execute it
}

The problem is that how can i get the correct value of finished inside the wait function.
AnswerRe: Access a pointer value changed in another class Pin
Victor Nijegorodov5-Oct-18 8:51
memberVictor Nijegorodov5-Oct-18 8:51 
GeneralRe: Access a pointer value changed in another class Pin
meerokh5-Oct-18 9:10
membermeerokh5-Oct-18 9:10 
GeneralRe: Access a pointer value changed in another class Pin
Victor Nijegorodov5-Oct-18 9:37
memberVictor Nijegorodov5-Oct-18 9:37 
AnswerRe: Access a pointer value changed in another class Pin
CPallini5-Oct-18 12:28
mvpCPallini5-Oct-18 12:28 
GeneralMessage Closed Pin
10-Oct-18 0:31
memberHenry John10-Oct-18 0:31 
QuestionRe: Access a pointer value changed in another class Pin
CPallini10-Oct-18 0:58
mvpCPallini10-Oct-18 0:58 
QuestionConversion from C to C#, Need C# Method Signature Pin
akvbsoft4-Oct-18 9:50
memberakvbsoft4-Oct-18 9:50 
AnswerRe: Conversion from C to C#, Need C# Method Signature Pin
vcbeaut4-Oct-18 17:48
membervcbeaut4-Oct-18 17:48 
AnswerRe: Conversion from C to C#, Need C# Method Signature Pin
Victor Nijegorodov4-Oct-18 22:43
memberVictor Nijegorodov4-Oct-18 22:43 
QuestionMake screen bigger Pin
Member 139824711-Oct-18 9:37
memberMember 139824711-Oct-18 9:37 
AnswerRe: Make screen bigger Pin
Member 139824711-Oct-18 9:55
memberMember 139824711-Oct-18 9:55 
GeneralRe: Make screen bigger Pin
Maximilien3-Oct-18 5:28
memberMaximilien3-Oct-18 5:28 
GeneralRe: Make screen bigger Pin
enhzflep3-Oct-18 8:38
memberenhzflep3-Oct-18 8:38 
JokeRe: Make screen bigger Pin
Richard Deeming3-Oct-18 11:10
mvpRichard Deeming3-Oct-18 11:10 
GeneralRe: Make screen bigger Pin
David Crow1-Oct-18 10:12
memberDavid Crow1-Oct-18 10:12 
AnswerRe: Make screen bigger Pin
Victor Nijegorodov1-Oct-18 10:20
memberVictor Nijegorodov1-Oct-18 10:20 
GeneralRe: Make screen bigger Pin
Member 139824711-Oct-18 10:28
memberMember 139824711-Oct-18 10:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web05 | 2.8.181207.3 | Last Updated 11 Dec 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid