Jump to content

  • Log In with Google      Sign In   
  • Create Account

Jason Goepel

Member Since 15 May 2013
Offline Last Active Sep 23 2016 06:38 AM

Posts I've Made

In Topic: Unsafe const &in

28 September 2015 - 12:25 PM

I think my browser had some trouble with the file uploader.


In Topic: Unsafe const &in

28 September 2015 - 08:42 AM

I have followed your suggestion and changed const &in to become const &inout.

 

I do find the automatic construction of a temporary variable passed to a const &inout parameter useful, so I have attempted a modification to make that work.  I have attached it as a patch.  It seems to work in my tests, but I am not sure if I am properly handling all cases.  If you don't incorporate this change officially, would you mind looking it over to see if I missed anything obvious to you?

 

Thanks


In Topic: "Null pointer access" putting object type in exception info

02 April 2015 - 08:26 AM

I'm going to try and hack something together.  My immediate purpose may be satisfied by adding more exception information when the exception is set within "CallSystemFunction."  I'll let you know if I come up with anything clever.


In Topic: asBEHAVE_REF_CAST / asBEHAVE_IMPLICIT_REF_CAST deprecated...

03 February 2015 - 07:36 AM

asBEHAVE_REF_CAST             ==>  opCast

asBEHAVE_IMPLICIT_REF_CAST    ==>  opImplCast

asBEHAVE_VALUE_CAST           ==>  opConv

asBEHAVE_IMPLICIT_VALUE_CAST  ==>  opImplConv


In Topic: Multithreading - Creating a Module

11 December 2014 - 11:53 AM

Thanks for the quick response, but I think there may still be a slight issue.  It seems like if two threads enter this block:

ACQUIRESHARED(engineRWLock);
if( lastModule && lastModule->name == name )
    retModule = lastModule;
else
{
    // TODO: optimize: Improve linear search
    for( asUINT n = 0; n < scriptModules.GetLength(); ++n )
        if( scriptModules[n] && scriptModules[n]->name == name )
        {
            lastModule = retModule = scriptModules[n];
            break;
        }
}
RELEASESHARED(engineRWLock);

 

Then there is the opportunity for:

Thread1:  "lastModule->name == name"    true

Thread2:  "scriptModules[n]->name == name"  true

Thread2:  "lastModule = retModule = scriptModules[n]"

Thread1:  "retModule = lastModule"

 

If that were to happen, then Thread1 would return the incorrect module.  It seems like "lastModule" should always be within an exclusive lock when being written to.


PARTNERS