Click here to Skip to main content
13,736,490 members

C / C++ / MFC

 
AnswerRe: Calculating decimal places - Pin
ptr_Electron16-Oct-18 2:55
memberptr_Electron16-Oct-18 2:55 
GeneralRe: Calculating decimal places - Pin
CPallini16-Oct-18 3:11
mvpCPallini16-Oct-18 3:11 
QuestionMessage Closed Pin
14-Oct-18 23:32
member14-Oct-18 23:32 
QuestionUsing assignment operator = for a class with const memeber variables? Pin
7-Oct-18 12:52
member7-Oct-18 12:52 
AnswerRe: Using assignment operator = for a class with const memeber variables? Pin
CPallini7-Oct-18 20:36
mvpCPallini7-Oct-18 20:36 
AnswerRe: Using assignment operator = for a class with const memeber variables? Pin
Richard MacCutchan7-Oct-18 21:47
protectorRichard MacCutchan7-Oct-18 21:47 
AnswerRe: Using assignment operator = for a class with const memeber variables? Pin
«_Superman_»9-Oct-18 1:51
professional«_Superman_»9-Oct-18 1:51 
QuestionAccess a pointer value changed in another class Pin
meerokh5-Oct-18 6:30
membermeerokh5-Oct-18 6: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 7:51
memberVictor Nijegorodov5-Oct-18 7:51 
GeneralRe: Access a pointer value changed in another class Pin
meerokh5-Oct-18 8:10
membermeerokh5-Oct-18 8:10 
GeneralRe: Access a pointer value changed in another class Pin
Victor Nijegorodov5-Oct-18 8:37
memberVictor Nijegorodov5-Oct-18 8:37 
AnswerRe: Access a pointer value changed in another class Pin
CPallini5-Oct-18 11:28
mvpCPallini5-Oct-18 11:28 
GeneralMessage Closed Pin
9-Oct-18 23:31
memberHenry John9-Oct-18 23:31 
QuestionRe: Access a pointer value changed in another class Pin
CPallini9-Oct-18 23:58
mvpCPallini9-Oct-18 23:58 
QuestionConversion from C to C#, Need C# Method Signature Pin
akvbsoft4-Oct-18 8:50
memberakvbsoft4-Oct-18 8:50 
AnswerRe: Conversion from C to C#, Need C# Method Signature Pin
vcbeaut4-Oct-18 16:48
membervcbeaut4-Oct-18 16:48 
AnswerRe: Conversion from C to C#, Need C# Method Signature Pin
Victor Nijegorodov4-Oct-18 21:43
memberVictor Nijegorodov4-Oct-18 21:43 
QuestionMake screen bigger Pin
Member 139824711-Oct-18 8:37
memberMember 139824711-Oct-18 8:37 
AnswerRe: Make screen bigger Pin
Member 139824711-Oct-18 8:55
memberMember 139824711-Oct-18 8:55 
GeneralRe: Make screen bigger Pin
Maximilien3-Oct-18 4:28
memberMaximilien3-Oct-18 4:28 
GeneralRe: Make screen bigger Pin
enhzflep3-Oct-18 7:38
memberenhzflep3-Oct-18 7:38 
JokeRe: Make screen bigger Pin
Richard Deeming3-Oct-18 10:10
mvpRichard Deeming3-Oct-18 10:10 
GeneralRe: Make screen bigger Pin
David Crow1-Oct-18 9:12
memberDavid Crow1-Oct-18 9:12 
AnswerRe: Make screen bigger Pin
Victor Nijegorodov1-Oct-18 9:20
memberVictor Nijegorodov1-Oct-18 9:20 
GeneralRe: Make screen bigger Pin
Member 139824711-Oct-18 9:28
memberMember 139824711-Oct-18 9: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
Web06-2016 | 2.8.180920.1 | Last Updated 19 Oct 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid