How can I stop my MacBook Pro from automatically sleeping when I lock the screen?
Had the same problem in my Macbook(15") pro running 10.9.4.

I wanted my Mac to be locked while I was away (so configured hot corners) but at the same time did not want it to sleep (irrespective of whether it is connected to power or not) so that my wifi will be "ON" always for my jabber &amp; mails. So here's what I did to prevent Mac from sleeping:


Open Terminal
Run sudo pmset -a sleep 0


Explanation of the command:


pmset command is to manipulate power management settings. 
-a specifies that the setting applies for all conditions (power &amp; battery)
sleep configure system sleep timer
0 to disable


Check out man pmset for more information.